APIdia Launch Partner
Top Description Inners Methods
com.sun.source.tree

public Interface LambdaExpressionTree

extends ExpressionTree
Known Direct Implementers
com.sun.tools.javac.tree.JCTree.JCLambda
Imports
java.util.List

A tree node for a lambda expression. For example:
()->{}
  (List<String> ls)->ls.size()
  (x,y)-> { return x + y; }
Since
1.8

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static enum
LambdaExpressionTree.BodyKind

Lambda expressions come in two forms:

  • expression lambdas, whose body is an expression, and
  • statement lambdas, whose body is a block

Method Summary

Modifier and TypeMethod and Description
public Tree

Returns:

the body
getBody
()

Returns the body of the lambda expression.

public LambdaExpressionTree.BodyKind

Returns:

the kind of the body
getBodyKind
()

Returns the kind of the body of the lambda expression.

public List<? extends VariableTree>

Returns:

the parameters
getParameters
()

Returns the parameters of this lambda expression.

Method Detail

getBodyback to summary
public Tree getBody()

Returns the body of the lambda expression.

Returns:Tree

the body

getBodyKindback to summary
public LambdaExpressionTree.BodyKind getBodyKind()

Returns the kind of the body of the lambda expression.

Returns:LambdaExpressionTree.BodyKind

the kind of the body

getParametersback to summary
public List<? extends VariableTree> getParameters()

Returns the parameters of this lambda expression.

Returns:List<? extends VariableTree>

the parameters

com.sun.source.tree back to summary

public final Enum LambdaExpressionTree.BodyKind

extends Enum<LambdaExpressionTree.BodyKind>
Class Inheritance

Lambda expressions come in two forms:

Field Summary

Modifier and TypeField and Description
public static final LambdaExpressionTree.BodyKind
EXPRESSION

enum constant for expression lambdas

public static final LambdaExpressionTree.BodyKind
STATEMENT

enum constant for statement lambdas

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static LambdaExpressionTree.BodyKind
public static LambdaExpressionTree.BodyKind[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

EXPRESSIONback to summary
public static final LambdaExpressionTree.BodyKind EXPRESSION

enum constant for expression lambdas

STATEMENTback to summary
public static final LambdaExpressionTree.BodyKind STATEMENT

enum constant for statement lambdas

Constructor Detail

BodyKindback to summary
private BodyKind()

Method Detail

valueOfback to summary
public static LambdaExpressionTree.BodyKind valueOf(String name)
valuesback to summary
public static LambdaExpressionTree.BodyKind[] values()