Class ColorAdapter
java.lang.Object
org.polyfrost.oneconfig.api.config.v1.serialize.adapter.Adapter<Color,int[]>
org.polyfrost.oneconfig.api.config.v1.serialize.adapter.impl.ColorAdapter
The only bundled adapter in the config system which makes colors a lot more readable when serialized
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondeserialize(int[] l) Deserialize your object
The form will be identical to what you made in theAdapter.serialize(Object)methodClass<int[]> Due to Java type erasure this method is used to get the type of the adapter
This is used internally to get what type adapter to useDue to Java type erasure this method is used to get the type of the adapter
This is used internally to get what type adapter to useint[]Convert the given object into a serializable form
The following types can be returned by this method and nothing more Primitive wrappers (anyNumberorCharacterorBoolean) AStringliteral or any class implementingCharSequenceAnEnumAn array of the above types including primitives such asbyte[]andint[]AListof the above types AMap<String,Object>of the above types mapped to Strings which are used as keys
Note that 'class' and 'value' are reserved keys and cannot be used Lists containing lists or maps containing maps (or lists) are also supported
-
Constructor Details
-
ColorAdapter
public ColorAdapter()
-
-
Method Details
-
deserialize
Description copied from class:AdapterDeserialize your object
The form will be identical to what you made in theAdapter.serialize(Object)method- Specified by:
deserializein classAdapter<Color,int[]> - Parameters:
l- the object (same as deserialize) to create your object from- Returns:
- the complete object
-
serialize
Description copied from class:AdapterConvert the given object into a serializable form
The following types can be returned by this method and nothing more- Primitive wrappers (any
NumberorCharacterorBoolean) - A
Stringliteral or any class implementingCharSequence - An
Enum - An array of the above types including primitives such as
byte[]andint[] - A
Listof the above types - A
Map<String,Object>of the above types mapped to Strings which are used as keys
Note that 'class' and 'value' are reserved keys and cannot be used - Lists containing lists or maps containing maps (or lists) are also supported
- Primitive wrappers (any
-
getTargetClass
Description copied from class:AdapterDue to Java type erasure this method is used to get the type of the adapter
This is used internally to get what type adapter to use- Specified by:
getTargetClassin classAdapter<Color,int[]>
-
getOutputClass
Description copied from class:AdapterDue to Java type erasure this method is used to get the type of the adapter
This is used internally to get what type adapter to use- Specified by:
getOutputClassin classAdapter<Color,int[]>
-