Package io.bootique.di
Class TypeLiteral<T>
java.lang.Object
io.bootique.di.TypeLiteral<T>
This class represents any generic type T, as there is no support for this in Java.
Usage:
TypeLiteralg<List<Integer>> type = new TypeLiteral<List<Integer>>(){};
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleaninthashCode()static <T> TypeLiteral<List<T>>listOf(TypeLiteral<? extends T> type) Creates TypeLiteral that represents List<T> type.static <T> TypeLiteral<List<T>>Creates TypeLiteral that represents List<T> type.static <K,V> TypeLiteral<Map<K, V>> mapOf(TypeLiteral<? extends K> keyType, TypeLiteral<? extends V> valueType) Creates TypeLiteral that represents Map<K, V< type.static <K,V> TypeLiteral<Map<K, V>> Creates TypeLiteral that represents Map<K, V< type.static <T> TypeLiteral<T>static <T> TypeLiteral<T>static <T> TypeLiteral<T>static <T> TypeLiteral<Optional<T>>optionalOf(TypeLiteral<? extends T> type) Creates TypeLiteral that represents Optional<T< type.static <T> TypeLiteral<Optional<T>>optionalOf(Class<? extends T> type) Creates TypeLiteral that represents Optional<T< type.static <T> TypeLiteral<Set<T>>setOf(TypeLiteral<? extends T> valueType) Creates TypeLiteral that represents Set<T< type.static <T> TypeLiteral<Set<T>>Creates TypeLiteral that represents Set<T< type.toString()
-
Constructor Details
-
TypeLiteral
protected TypeLiteral()
-
-
Method Details
-
of
-
of
-
of
-
listOf
Creates TypeLiteral that represents List<T> type. -
listOf
Creates TypeLiteral that represents List<T> type. -
setOf
Creates TypeLiteral that represents Set<T< type. -
setOf
Creates TypeLiteral that represents Set<T< type. -
mapOf
public static <K,V> TypeLiteral<Map<K,V>> mapOf(Class<? extends K> keyType, Class<? extends V> valueType) Creates TypeLiteral that represents Map<K, V< type. -
mapOf
public static <K,V> TypeLiteral<Map<K,V>> mapOf(TypeLiteral<? extends K> keyType, TypeLiteral<? extends V> valueType) Creates TypeLiteral that represents Map<K, V< type. -
optionalOf
Creates TypeLiteral that represents Optional<T< type. -
optionalOf
Creates TypeLiteral that represents Optional<T< type. -
getRawType
-
equals
-
hashCode
public int hashCode() -
toString
-