public final class TypeTokens extends Object
TypeToken instances.| Modifier and Type | Method and Description |
|---|---|
static <T> com.google.common.reflect.TypeToken<List<T>> |
listOf(Class<T> eltType)
Create a
TypeToken that represents a List whose elements
are of the given type. |
static <T> com.google.common.reflect.TypeToken<List<T>> |
listOf(com.google.common.reflect.TypeToken<T> eltType)
Create a
TypeToken that represents a List whose elements
are of the given type. |
static <K,V> com.google.common.reflect.TypeToken<Map<K,V>> |
mapOf(Class<K> keyType,
Class<V> valueType)
Create a
TypeToken that represents a Map whose keys
and values are of the given key and value types. |
static <K,V> com.google.common.reflect.TypeToken<Map<K,V>> |
mapOf(com.google.common.reflect.TypeToken<K> keyType,
com.google.common.reflect.TypeToken<V> valueType)
Create a
TypeToken that represents a Map whose keys
and values are of the given key and value types. |
static <T> com.google.common.reflect.TypeToken<Set<T>> |
setOf(Class<T> eltType)
Create a
TypeToken that represents a Set whose elements
are of the given type. |
static <T> com.google.common.reflect.TypeToken<Set<T>> |
setOf(com.google.common.reflect.TypeToken<T> eltType)
Create a
TypeToken that represents a Set whose elements
are of the given type. |
public static <T> com.google.common.reflect.TypeToken<List<T>> listOf(Class<T> eltType)
TypeToken that represents a List whose elements
are of the given type.T - The list element type.eltType - The list element type.TypeToken that represents a List whose elements
are of the given type.public static <T> com.google.common.reflect.TypeToken<List<T>> listOf(com.google.common.reflect.TypeToken<T> eltType)
TypeToken that represents a List whose elements
are of the given type.T - The list element type.eltType - The list element type.TypeToken that represents a List whose elements
are of the given type.public static <T> com.google.common.reflect.TypeToken<Set<T>> setOf(Class<T> eltType)
TypeToken that represents a Set whose elements
are of the given type.T - The set element type.eltType - The set element type.TypeToken that represents a Set whose elements
are of the given type.public static <T> com.google.common.reflect.TypeToken<Set<T>> setOf(com.google.common.reflect.TypeToken<T> eltType)
TypeToken that represents a Set whose elements
are of the given type.T - The set element type.eltType - The set element type.TypeToken that represents a Set whose elements
are of the given type.public static <K,V> com.google.common.reflect.TypeToken<Map<K,V>> mapOf(Class<K> keyType, Class<V> valueType)
TypeToken that represents a Map whose keys
and values are of the given key and value types.K - The map key type.V - The map value typekeyType - The map key type.valueType - The map value typeTypeToken that represents a Map whose keys
and values are of the given key and value typespublic static <K,V> com.google.common.reflect.TypeToken<Map<K,V>> mapOf(com.google.common.reflect.TypeToken<K> keyType, com.google.common.reflect.TypeToken<V> valueType)
TypeToken that represents a Map whose keys
and values are of the given key and value types.K - The map key type.V - The map value typekeyType - The map key type.valueType - The map value typeTypeToken that represents a Map whose keys
and values are of the given key and value types