Class LambdaParameter
- java.lang.Object
-
- com.tonic.analysis.source.ast.expr.LambdaParameter
-
public final class LambdaParameter extends Object
A lambda parameter with a name, a type, and whether the type is implicit in source.
-
-
Constructor Summary
Constructors Constructor Description LambdaParameter(String name, SourceType type, boolean implicitType)Creates a lambda parameter.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object o)static LambdaParameterexplicit(SourceType type, String name)Creates an explicitly typed parameter.inthashCode()static LambdaParameterimplicit(String name, SourceType inferredType)Creates an implicitly typed parameter.booleanimplicitType()Stringname()StringtoJavaSource()StringtoString()SourceTypetype()
-
-
-
Constructor Detail
-
LambdaParameter
public LambdaParameter(String name, SourceType type, boolean implicitType)
Creates a lambda parameter.- Parameters:
name- the parameter nametype- the parameter type, may be nullimplicitType- true if the type is omitted in source
-
-
Method Detail
-
explicit
public static LambdaParameter explicit(SourceType type, String name)
Creates an explicitly typed parameter.- Parameters:
type- the declared parameter typename- the parameter name- Returns:
- the new parameter
-
implicit
public static LambdaParameter implicit(String name, SourceType inferredType)
Creates an implicitly typed parameter.- Parameters:
name- the parameter nameinferredType- the inferred parameter type- Returns:
- the new parameter
-
toJavaSource
public String toJavaSource()
- Returns:
- the parameter as source text, with the type prefixed only when explicit
-
name
public String name()
- Returns:
- the parameter name
-
type
public SourceType type()
- Returns:
- the parameter type, may be null
-
implicitType
public boolean implicitType()
- Returns:
- true if the type is omitted in source
-
-