Package io.avaje.jsonb
Class Types
- java.lang.Object
-
- io.avaje.jsonb.Types
-
public class Types extends Object
Factory methods for types.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Type
arrayOf(Type elementType)
Returns an array type whose elements are all instances ofcomponentType
.static Type
listOf(Type elementType)
Returns a Type that is a List of the given element type.static Type
mapOf(Type valueElementType)
Return the Type for a Map with String keys and the given value element type.static ParameterizedType
newParameterizedType(Type rawType, Type... typeArguments)
Returns a new parameterized type, applyingtypeArguments
torawType
.static Class<?>
rawType(Type type)
Return the raw type for the given potentially generic type.static Type
setOf(Type elementType)
Returns a Type that is a Set of the given element type.static Type
streamOf(Type elementType)
Returns a Type that is a Stream of the given element type.static Type[]
typeArguments(Type type)
Return the generic type arguments expecting type to be a ParameterizedType.
-
-
-
Method Detail
-
arrayOf
public static Type arrayOf(Type elementType)
Returns an array type whose elements are all instances ofcomponentType
.
-
listOf
public static Type listOf(Type elementType)
Returns a Type that is a List of the given element type.
-
setOf
public static Type setOf(Type elementType)
Returns a Type that is a Set of the given element type.
-
streamOf
public static Type streamOf(Type elementType)
Returns a Type that is a Stream of the given element type.
-
mapOf
public static Type mapOf(Type valueElementType)
Return the Type for a Map with String keys and the given value element type.- Parameters:
valueElementType
- The type of the values in the Map.- Returns:
- Type for a Map with String keys and the given value element type.
-
newParameterizedType
public static ParameterizedType newParameterizedType(Type rawType, Type... typeArguments)
Returns a new parameterized type, applyingtypeArguments
torawType
. Use this method ifrawType
is not enclosed in another type.
-
rawType
public static Class<?> rawType(Type type)
Return the raw type for the given potentially generic type.
-
-