public class FunctionalType extends ValueType
ValueType.FieldReceiver| 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 FunctionalType |
intUnaryOperator(javax.lang.model.type.PrimitiveType type) |
static java.util.Optional<FunctionalType> |
maybeFunctionalType(javax.lang.model.type.DeclaredType type,
javax.lang.model.util.Elements elements,
javax.lang.model.util.Types types) |
static java.util.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) |
static FunctionalType |
unboxedUnaryOperator(javax.lang.model.type.TypeMirror type,
javax.lang.model.util.Types types) |
public static FunctionalType consumer(javax.lang.model.type.TypeMirror type)
public static FunctionalType unaryOperator(javax.lang.model.type.TypeMirror type)
public static FunctionalType intUnaryOperator(javax.lang.model.type.PrimitiveType type)
public static FunctionalType unboxedUnaryOperator(javax.lang.model.type.TypeMirror type, javax.lang.model.util.Types types)
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 java.util.Optional<FunctionalType> maybeFunctionalType(javax.lang.model.type.TypeMirror type, javax.lang.model.util.Elements elements, javax.lang.model.util.Types types)
public static java.util.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