java.lang.Object
io.avaje.jsonb.Types
Factory methods for types.
-
Method Summary
Modifier and TypeMethodDescriptionstatic GenericArrayType
Returns an array type whose elements are all instances ofcomponentType
.static boolean
isGenericTypeOf
(Type jsonType, Class<?> adapterClass) Helper method to determine if the given type can be handled by an adapterstatic ParameterizedType
Returns a Type that is a List of the given element type.static ParameterizedType
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 ParameterizedType
optionalOf
(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 ParameterizedType
Returns a Type that is a Set of the given element type.static ParameterizedType
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 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, applyingtypeArguments
torawType
. Use this method ifrawType
is 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
-