public final class Serializers
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static void |
add(TypeAdapter<?> typeAdapter)
Adds the given type adapter.
|
static void |
cleanUpAll() |
static <T> TypeAdapter<T> |
get(DataType<T> type)
Gets the type adapter for the given data type, or
null if no such adapter exists. |
static java.util.Collection<TypeAdapter> |
getAdapters() |
static <T> java.util.Optional<TypeAdapter<T>> |
getOptional(DataType<T> type)
Gets an optional containing the adapter for the given data type, or an empty optional if there is no such adapter.
|
static boolean |
hasSerializer(DataType<?> type)
Checks if there is an adapter for the given data type.
|
static void |
remove(TypeAdapter typeAdapter)
Removes the given type adapter.
|
public static void add(TypeAdapter<?> typeAdapter)
typeAdapter
- the type adapter to addpublic static void remove(TypeAdapter typeAdapter)
typeAdapter
- the type adapter to removepublic static <T> TypeAdapter<T> get(DataType<T> type)
null
if no such adapter exists.type
- the data type to get the adapter forpublic static boolean hasSerializer(DataType<?> type)
public static <T> java.util.Optional<TypeAdapter<T>> getOptional(DataType<T> type)
public static void cleanUpAll()
public static java.util.Collection<TypeAdapter> getAdapters()