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.Class<int[]> Due to Java type erasure, this method is used to get the type of the adapter.Due to Java type erasure, this method is used to get the type of the adapter.int[]Convert the given object into a serializable form.
-
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
Number,Character,Boolean) - A
Stringliteral or any class implementingCharSequence - An
Enum - An array of the above types, including primitives (e.g.
byte[],int[]..) - 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[]>
-