public final class DefaultMapDataSerializer extends Object implements MapDataSerializer
| Constructor and Description |
|---|
DefaultMapDataSerializer() |
| Modifier and Type | Method and Description |
|---|---|
CellData[] |
deserialize(String mapData)
Parse serialized map data to cells
|
void |
disableCache()
Disable cell data cache
|
void |
enableCache()
Enable the cell data cache
Once enable, deserialize two same cell data will return the same cell instance
|
String |
serialize(CellData[] cells)
Serialize the cells to a string
The result value must be compatible with deserialize()
So, the code `serializer.serialize(serializer.deserialize(mapData)).equals(mapData)` must always return true
|
MapDataSerializer |
withKey(Key key)
Get a MapDataSerializer for encrypted map with the given key
Use the current serializer as inner serializer (and also use the current cache)
|
MapDataSerializer |
withKey(@MinLen(value=2) String key)
Get a MapDataSerializer for encrypted map with the given key
This is equivalent to `serializer.withKey(Key.parse(key));`
CellData[] cells = serializer.withKey(gdm.key()).deserialize(mapData);
|
public CellData[] deserialize(String mapData)
MapDataSerializerdeserialize in interface MapDataSerializermapData - The raw map datapublic String serialize(CellData[] cells)
MapDataSerializerserialize in interface MapDataSerializercells - Cells to serializepublic void enableCache()
public void disableCache()
public MapDataSerializer withKey(Key key)
key - The encryption keypublic MapDataSerializer withKey(@MinLen(value=2) String key)
CellData[] cells = serializer.withKey(gdm.key()).deserialize(mapData);
key - The encryption key as stringCopyright © 2022. All rights reserved.