Class Suppliers
java.lang.Object
com.google.errorprone.suppliers.Suppliers
- Author:
- alexeagle@google.com (Alex Eagle)
-
Field Summary
Modifier and TypeFieldDescriptionstatic final Supplier
<com.sun.tools.javac.code.Type> static final Supplier
<com.sun.tools.javac.code.Type> static final Supplier
<com.sun.tools.javac.code.Type> static final Supplier
<com.sun.tools.javac.code.Type> static final Supplier
<com.sun.tools.javac.code.Type> static final Supplier
<com.sun.tools.javac.code.Type> static final Supplier
<com.sun.tools.javac.code.Type> static final Supplier
<com.sun.tools.javac.code.Type> static final Supplier
<com.sun.tools.javac.code.Type> static final Supplier
<com.sun.tools.javac.code.Type> static final Supplier
<com.sun.tools.javac.code.Type> static final Supplier
<com.sun.tools.javac.code.Type> static final Supplier
<com.sun.tools.javac.code.Type> static final Supplier
<com.sun.tools.javac.code.Type> static final Supplier
<com.sun.tools.javac.code.Type> static final Supplier
<com.sun.tools.javac.code.Type> static final Supplier
<com.sun.tools.javac.code.Type> static final Supplier
<com.sun.tools.javac.code.Type> -
Method Summary
Modifier and TypeMethodDescriptionstatic Supplier
<com.sun.tools.javac.code.Type> static com.google.common.collect.ImmutableList
<Supplier<com.sun.tools.javac.code.Type>> fromStrings
(Iterable<String> types) static Supplier
<com.sun.tools.javac.code.Type> genericTypeOf
(Supplier<com.sun.source.tree.ExpressionTree> expressionSupplier, int n) Supplies the n'th generic type of the given expression.static Supplier
<com.sun.tools.javac.code.Type> genericTypeOfType
(Supplier<com.sun.tools.javac.code.Type> typeSupplier, int n) Supplies the n'th generic type of the given expression.static <T> Supplier
<T> identitySupplier
(T toSupply) Supplies what was given.static Supplier
<com.sun.source.tree.ExpressionTree> Supplies the expression which gives the instance of an object that will receive the method call.static Supplier
<com.sun.tools.javac.code.Type> Supplies the expression which gives the instance of an object that will receive the method call.static Supplier
<com.sun.tools.javac.code.Type> typeFromClass
(Class<?> inputClass) Given the class representation of a type, supplies the corresponding type.static Supplier
<com.sun.tools.javac.code.Type> typeFromString
(String typeString) Given the string representation of a type, supplies the corresponding type.
-
Field Details
-
JAVA_LANG_VOID_TYPE
-
VOID_TYPE
-
JAVA_LANG_BOOLEAN_TYPE
-
JAVA_LANG_INTEGER_TYPE
-
JAVA_LANG_LONG_TYPE
-
STRING_TYPE
-
BOOLEAN_TYPE
-
BYTE_TYPE
-
SHORT_TYPE
-
INT_TYPE
-
LONG_TYPE
-
DOUBLE_TYPE
-
CHAR_TYPE
-
OBJECT_TYPE
-
EXCEPTION_TYPE
-
THROWABLE_TYPE
-
ANNOTATION_TYPE
-
ENCLOSING_CLASS
-
-
Method Details
-
genericTypeOf
public static Supplier<com.sun.tools.javac.code.Type> genericTypeOf(Supplier<com.sun.source.tree.ExpressionTree> expressionSupplier, int n) Supplies the n'th generic type of the given expression. For example, inMap<A,B> c;
for the expression c and n=1, the result is the type ofB
. If there are an insufficient number of type arguments, this method will return thejava.lang.Object
type from symbol table.- Parameters:
expressionSupplier
- a supplier of the expression which has a generic typen
- the position of the generic argument
-
genericTypeOfType
public static Supplier<com.sun.tools.javac.code.Type> genericTypeOfType(Supplier<com.sun.tools.javac.code.Type> typeSupplier, int n) Supplies the n'th generic type of the given expression. For example, inMap<A,B> c;
for the type of c and n=1, the result is the type ofB
. If there are an insufficient number of type arguments, this method will return thejava.lang.Object
type from symbol table.- Parameters:
typeSupplier
- a supplier of the expression which has a generic typen
- the position of the generic argument
-
receiverType
Supplies the expression which gives the instance of an object that will receive the method call. For example, ina.getB().getC()
if the visitor is currently visiting thegetC()
method invocation, then this supplier gives the expressiona.getB()
. -
receiverInstance
Supplies the expression which gives the instance of an object that will receive the method call. For example, ina.getB().getC()
if the visitor is currently visiting thegetC()
method invocation, then this supplier gives the expressiona.getB()
. -
typeFromString
-
typeFromClass
-
identitySupplier
Supplies what was given. Useful for adapting to methods that require a supplier.- Parameters:
toSupply
- the item to supply
-
arrayOf
-
fromStrings
-