public class FunctionalType extends ValueType
ValueType.FieldReceiver| Modifier and Type | Field and Description |
|---|---|
static QualifiedName |
BI_CONSUMER |
static QualifiedName |
CONSUMER |
static QualifiedName |
UNARY_OPERATOR |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addFields(ValueType.FieldReceiver fields)
Implement this method to report the name and value of each field.
|
boolean |
canReturnNull() |
static FunctionalType |
consumer(javax.lang.model.type.TypeMirror type) |
static FunctionalType |
functionalTypeAcceptedByMethod(javax.lang.model.type.DeclaredType type,
java.lang.String methodName,
FunctionalType prototype,
javax.lang.model.util.Elements elements,
javax.lang.model.util.Types types)
Returns the functional type accepted by
methodName on type, assignable to
prototype, or prototype itself if no such method has been declared. |
Type |
getFunctionalInterface() |
java.lang.String |
getMethodName() |
java.util.List<javax.lang.model.type.TypeMirror> |
getParameters() |
javax.lang.model.type.TypeMirror |
getReturnType() |
static com.google.common.base.Optional<FunctionalType> |
maybeFunctionalType(javax.lang.model.type.DeclaredType type,
javax.lang.model.util.Elements elements,
javax.lang.model.util.Types types) |
static com.google.common.base.Optional<FunctionalType> |
maybeFunctionalType(javax.lang.model.type.TypeMirror type,
javax.lang.model.util.Elements elements,
javax.lang.model.util.Types types) |
java.lang.String |
toString() |
static FunctionalType |
unaryOperator(javax.lang.model.type.TypeMirror type) |
public static final QualifiedName CONSUMER
public static final QualifiedName BI_CONSUMER
public static final QualifiedName UNARY_OPERATOR
public static FunctionalType consumer(javax.lang.model.type.TypeMirror type)
public static FunctionalType unaryOperator(javax.lang.model.type.TypeMirror type)
public static FunctionalType functionalTypeAcceptedByMethod(javax.lang.model.type.DeclaredType type, java.lang.String methodName, FunctionalType prototype, javax.lang.model.util.Elements elements, javax.lang.model.util.Types types)
methodName on type, assignable to
prototype, or prototype itself if no such method has been declared.
Used to allow the user to override the functional interface used on builder methods, e.g. to force boxing, or to use Guava types.
public static com.google.common.base.Optional<FunctionalType> maybeFunctionalType(javax.lang.model.type.TypeMirror type, javax.lang.model.util.Elements elements, javax.lang.model.util.Types types)
public static com.google.common.base.Optional<FunctionalType> maybeFunctionalType(javax.lang.model.type.DeclaredType type, javax.lang.model.util.Elements elements, javax.lang.model.util.Types types)
public Type getFunctionalInterface()
public java.lang.String getMethodName()
public java.util.List<javax.lang.model.type.TypeMirror> getParameters()
public javax.lang.model.type.TypeMirror getReturnType()
public boolean canReturnNull()
protected void addFields(ValueType.FieldReceiver fields)
ValueType