Package de.alpharogroup.gson.factory
Class TypeFactory
- java.lang.Object
-
- de.alpharogroup.gson.factory.TypeFactory
-
public final class TypeFactory extends java.lang.ObjectThe factory classTypeFactoryfor creatingTypeobjects
-
-
Constructor Summary
Constructors Constructor Description TypeFactory()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T> java.lang.reflect.TypenewCollectionTypeToken(java.lang.Class<T> collectionType)Factory method for create a newTypefor convert all derivedCollectionobjectsstatic <T extends java.util.Collection,E>
java.lang.reflect.TypenewCollectionTypeToken(java.lang.Class<T> collectionClass, java.lang.Class<E> elementClass)Factory method for create a newTypefor convert json objects from all derivedCollectionobjectsstatic <T> java.lang.reflect.TypenewListTypeToken(java.lang.Class<T> listType)Factory method for create a newTypefor convertListobjectsstatic <K,V>
java.lang.reflect.TypenewMapTypeToken(java.lang.Class<K> keyType, java.lang.Class<V> valueType)Factory method for create a newTypefor convert json objects from all derivedMapobjectsstatic <M,K,V>
java.lang.reflect.TypenewMapTypeToken(java.lang.Class<M> mapClass, java.lang.Class<K> keyType, java.lang.Class<V> valueType)Factory method for create a newTypefor convert json objects from all derivedMapobjects
-
-
-
Method Detail
-
newListTypeToken
public static <T> java.lang.reflect.Type newListTypeToken(java.lang.Class<T> listType)
Factory method for create a newTypefor convertListobjects- Parameters:
listType- the list type- Returns:
- the new
Typeobject
-
newCollectionTypeToken
public static <T extends java.util.Collection,E> java.lang.reflect.Type newCollectionTypeToken(java.lang.Class<T> collectionClass, java.lang.Class<E> elementClass)Factory method for create a newTypefor convert json objects from all derivedCollectionobjects- Parameters:
collectionClass- the collection classelementClass- the element class- Returns:
- the new
Typeobject
-
newCollectionTypeToken
public static <T> java.lang.reflect.Type newCollectionTypeToken(java.lang.Class<T> collectionType)
Factory method for create a newTypefor convert all derivedCollectionobjects- Parameters:
collectionType- the collection type- Returns:
- the new
Typeobject
-
newMapTypeToken
public static <M,K,V> java.lang.reflect.Type newMapTypeToken(java.lang.Class<M> mapClass, java.lang.Class<K> keyType, java.lang.Class<V> valueType)Factory method for create a newTypefor convert json objects from all derivedMapobjects- Parameters:
mapClass- the map classkeyType- the key type classvalueType- the value type class- Returns:
- the new
Typeobject
-
newMapTypeToken
public static <K,V> java.lang.reflect.Type newMapTypeToken(java.lang.Class<K> keyType, java.lang.Class<V> valueType)Factory method for create a newTypefor convert json objects from all derivedMapobjects- Parameters:
keyType- the key type classvalueType- the value type class- Returns:
- the new
Typeobject
-
-