Class ObjectSerializer
java.lang.Object
org.polyfrost.oneconfig.api.config.v1.serialize.ObjectSerializer
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intModifier.SYNTHETIC | Modifier.TRANSIENT | Modifier.STATICstatic final ObjectSerializer -
Method Summary
Modifier and TypeMethodDescriptiondeserialize(Map<String, Object> in) Deserialize the given complex object map.fieldStream(Class<?> cls) <T> Adapter<T, ?> getAdapter(Class<T> cls) static Field[]getAllFields(Class<?> cls) static booleanisImmutable(Class<?> cls) true if no instance field of this class can be assigned, i.e.static booleanisSerializable(Object in) static <T> Toverwrite(T self, T input) voidregisterTypeAdapter(Adapter<?, ?> adapter) voidregisterTypeAdapter(Adapter<?, ?>... adapters) Convert the given object into a series of simple values that should be supported by most backend serializers.
-
Field Details
-
INSTANCE
-
FIELD_SKIP_MODIFIERS
public static final int FIELD_SKIP_MODIFIERSModifier.SYNTHETIC | Modifier.TRANSIENT | Modifier.STATIC- See Also:
-
-
Method Details
-
isSerializable
-
getAllFields
-
isImmutable
true if no instance field of this class can be assigned, i.e. the class is a value type. Such objects can only be replaced, never mutated in place. -
fieldStream
-
registerTypeAdapter
-
registerTypeAdapter
-
serialize
-
serialize
-
getAdapter
-
serialize
Convert the given object into a series of simple values that should be supported by most backend serializers.- Parameters:
in- the objectuseLists- if your serializer uses lists instead of arrays for collections of itemsboxArrays- if your serializer requires boxed primitive arrays- Returns:
- the source object, in a simple form
- See Also:
-
deserialize
Deserialize the given complex object map. The map must contain the class field.- Parameters:
in- the map- Returns:
- the completed object
-
overwrite
public static <T> T overwrite(T self, T input)
-