Basic Usage

Once you have configured a MapMaid instance, you can start serializing and deserializing objects.

Serializing to JSON

final String json = mapMaid.serializeToJson(EMAIL);

Deserializing from JSON

final Email deserializedEmail = mapMaid.deserializeJson(json, Email.class);

Serializing to YAML

final String yaml = mapMaid.serializeToYaml(EMAIL);

Deserializing from YAML

final Email deserializedEmail = mapMaid.deserializeYaml(yaml, Email.class);

Serializing to XML

final String xml = mapMaid.serializeToXml(EMAIL);

Deserializing from XML

final Email deserializedEmail = mapMaid.deserializeXml(xml, Email.class);

Serializing to a custom format

final String customFormat = mapMaid.serializeTo(EMAIL, MarshallingType.marshallingType("YOUR_CUSTOM_FORMAT"));

Deserializing from a custom format

final Email deserializedEmail = mapMaid.deserialize(customFormat, Email.class, MarshallingType.marshallingType("YOUR_CUSTOM_FORMAT"));