Package io.avaje.json.core
Class CoreTypes
java.lang.Object
io.avaje.json.core.CoreTypes
Provides core JsonAdapter for common types.
Supports Boolean, Integer, Long, Double, Float, String.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceThe basic JsonAdapter types. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic JsonAdapter<byte[]> Return a JsonAdapter forbyte[].static <T> JsonAdapter<T> Return a core supported type adapter or null.static <T> JsonAdapter<T> createArray(Class<?> elementType) Create a JsonAdapter for an Array of the given element type.static <T> JsonAdapter<T> createArray(Class<?> elementType, JsonAdapter<Object> adapter) Create a JsonAdapter for an Array of the given type.static CoreTypes.CoreAdaptersCreate a JsonAdapter that supports simple types including scalar types of: String, Integer, Long, Double, Boolean plus List and Map of those types.static <V> JsonAdapter<List<V>> createList(JsonAdapter<V> elementAdapter) Create a JsonAdapter for a List with a given adapter for the elements.static <V> JsonAdapter<Map<String, V>> createMap(JsonAdapter<V> valueAdapter) Create a JsonAdapter for a Map with a given adapter for the values.static <V> JsonAdapter<Set<V>> createSet(JsonAdapter<V> elementAdapter) Create a JsonAdapter for a Set with a given adapter for the elements.
-
Constructor Details
-
CoreTypes
public CoreTypes()
-
-
Method Details
-
create
Return a core supported type adapter or null.Supports Boolean, Integer, Long, Double, Float, String.
- Parameters:
type- The type to get the adapter for.- Returns:
- The JsonAdapter for the type or null.
-
createArray
Create a JsonAdapter for an Array of the given element type. -
createArray
Create a JsonAdapter for an Array of the given type.- Parameters:
elementType- The element type of the array.- Returns:
- The JsonAdapter for an Array of the given type.
-
byteArray
Return a JsonAdapter forbyte[]. -
createMap
Create a JsonAdapter for a Map with a given adapter for the values.- Parameters:
valueAdapter- The JsonAdapter used for the values in the map.- Returns:
- The JsonAdapter for the map.
-
createList
Create a JsonAdapter for a List with a given adapter for the elements.- Parameters:
elementAdapter- The JsonAdapter used for the elements in the list.- Returns:
- The JsonAdapter for the list.
-
createSet
Create a JsonAdapter for a Set with a given adapter for the elements.- Parameters:
elementAdapter- The JsonAdapter used for the elements in the set.- Returns:
- The JsonAdapter for the set.
-
createCoreAdapters
Create a JsonAdapter that supports simple types including scalar types of: String, Integer, Long, Double, Boolean plus List and Map of those types.
-