Interface JLambda

All Superinterfaces:
JExpr
All Known Implementing Classes:
JLambdaImpl

public interface JLambda extends JExpr
A Java 8 lambda.
  • Method Details

    • param

      JLambda param(JType type, String name)
      Add a declared-type parameter to this lambda.
      Parameters:
      type - the parameter type
      name - the parameter name
      Returns:
      this lambda
    • param

      JLambda param(String typeName, String name)
      Add a declared-type parameter to this lambda.
      Parameters:
      typeName - the parameter type name
      name - the parameter name
      Returns:
      this lambda
    • param

      JLambda param(Class<?> type, String name)
      Add a declared-type parameter to this lambda.
      Parameters:
      type - the parameter type
      name - the parameter name
      Returns:
      this lambda
    • param

      JLambda param(String name)
      Add an inferred-type parameter to this lambda. If one parameter is inferred, all will be, despite any declared parameter type.
      Parameters:
      name - the parameter name
      Returns:
      this lambda
    • body

      JBlock body()
      Get the lambda body as a block. Clears any expression body.
      Returns:
      the lambda body
    • body

      JLambda body(JExpr expr)
      Set the lambda body as an expression. Clears any block body or previously set expression body.
      Parameters:
      expr - the expression body of this lambda
      Returns:
      this lambda