java.lang.Object
io.avaje.jsonb.Types
Factory methods for types.
-
Method Summary
Modifier and TypeMethodDescriptionstatic GenericArrayTypeReturns an array type whose elements are all instances ofcomponentType.static booleanisGenericTypeOf(Type jsonType, Class<?> adapterClass) Helper method to determine if the given type can be handled by an adapterstatic ParameterizedTypeReturns a Type that is a List of the given element type.static ParameterizedTypeReturn the Type for a Map with String keys and the given value element type.static ParameterizedTypenewParameterizedType(Type rawType, Type... typeArguments) Returns a new parameterized type, applyingtypeArgumentstorawType.static ParameterizedTypeoptionalOf(Type valueElementType) Returns a Type that is an Optional of the given element type.static Class<?> Return the raw type for the given potentially generic type.static ParameterizedTypeReturns a Type that is a Set of the given element type.static ParameterizedTypeReturns 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 Details
-
arrayOf
Returns an array type whose elements are all instances ofcomponentType. -
listOf
Returns a Type that is a List of the given element type. -
setOf
Returns a Type that is a Set of the given element type. -
streamOf
Returns a Type that is a Stream of the given element type. -
mapOf
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.
-
optionalOf
Returns a Type that is an Optional of the given element type. -
newParameterizedType
Returns a new parameterized type, applyingtypeArgumentstorawType. Use this method ifrawTypeis not enclosed in another type. -
rawType
Return the raw type for the given potentially generic type. -
typeArguments
Return the generic type arguments expecting type to be a ParameterizedType. -
isGenericTypeOf
Helper method to determine if the given type can be handled by an adapter
-