Interface Serializer<T>
- Type Parameters:
T- the type of data that your serializer outputs and accepts as input
public interface Serializer<T>
A serializer is a class that is capable of turning a
Trees are the primary data structure in OneConfig and are used to represent configuration data
Each node is a key-value pair of either a string and a sub-tree or a string and some data
Trees can contain arbitrary potentially complex data types in them so you need to be able to serialize and deserialize this data into a specific type
The easiest way to do this is to use the builtin
The following types are used by this and so you need to be able to serialize and deserialize them
Tree into a specific type Serializer and back again
Trees are the primary data structure in OneConfig and are used to represent configuration data
Each node is a key-value pair of either a string and a sub-tree or a string and some data
Trees can contain arbitrary potentially complex data types in them so you need to be able to serialize and deserialize this data into a specific type
The easiest way to do this is to use the builtin
ObjectSerializer which provides
simple methods to convert objects into simple types along with the facility to use defined Adapters
The following types are used by this and so you need to be able to serialize and deserialize them
- primitive type wrappers (Number and Character and Boolean)
- CharSequence
- Lists or Arrays of the above types (at your discretion)
- Map containing the above types
-
Method Summary
-
Method Details
-
serialize
Serialize the given tree into type T- Returns:
- the serialized data
-
deserialize
Return a new tree with the data in it- Parameters:
src- the serialized data- Returns:
- the tree created from the data
-