public interface ObjectMap
extends com.esotericsoftware.kryo.KryoSerializable
Modifier and Type | Method and Description |
---|---|
default java.util.Map<java.lang.String,java.lang.Object> |
getObjectMap()
Creates a map of the important fields for the instance, suitable for serialization.
|
long |
getSerializationVersion()
Returns the current version of the serialization format.
|
int |
getVersion()
Returns the current class version.
|
default void |
init(java.util.Map<java.lang.String,java.lang.Object> objectMap)
Initializes an instance with an object map.
|
void |
initCurrentVersion(java.util.Map<java.lang.String,java.lang.Object> objectMap)
Initializes an instance with a current-version object graph.
|
default void |
initPreviousVersion(java.util.Map<java.lang.String,java.lang.Object> objectMap,
int version)
Handles requests to initialize an instance with a previous version of an object graph.
|
default void |
initUnknownVersion(java.util.Map<java.lang.String,java.lang.Object> objectMap,
int version)
Handles requests to initialize an instance with an unknown (future, undefined, etc.) version of an object graph.
|
default void |
load(java.io.File inFile)
Reads a model from disk
|
default void |
read(com.esotericsoftware.kryo.Kryo kryo,
com.esotericsoftware.kryo.io.Input input)
Reads a Kryo-serialized object graph.
|
default void |
save(java.io.File outFile)
Saves a model to disk
|
default void |
write(com.esotericsoftware.kryo.Kryo kryo,
com.esotericsoftware.kryo.io.Output output)
Serializes the current instance as a Kryo object.
|
long getSerializationVersion()
int getVersion()
default java.util.Map<java.lang.String,java.lang.Object> getObjectMap()
default void init(java.util.Map<java.lang.String,java.lang.Object> objectMap)
objectMap
- Map of field:value pairsjava.lang.UnsupportedOperationException
- if serialization versions don't matchvoid initCurrentVersion(java.util.Map<java.lang.String,java.lang.Object> objectMap)
objectMap
- object graph for initializationdefault void initPreviousVersion(java.util.Map<java.lang.String,java.lang.Object> objectMap, int version)
objectMap
- object graph for initializationversion
- version of object graphdefault void initUnknownVersion(java.util.Map<java.lang.String,java.lang.Object> objectMap, int version)
objectMap
- object graphversion
- versionjava.lang.UnsupportedOperationException
- by defaultdefault void save(java.io.File outFile) throws java.io.IOException
outFile
- destination filejava.io.IOException
- if an I/O error occurs (file not found, insufficient permissions, etc.)default void load(java.io.File inFile) throws java.io.IOException
inFile
- source filejava.io.IOException
- if an I/O error occurs (file not found, insufficient permissions, etc.)default void read(com.esotericsoftware.kryo.Kryo kryo, com.esotericsoftware.kryo.io.Input input)
read
in interface com.esotericsoftware.kryo.KryoSerializable
kryo
- Kryo instanceinput
- Inputdefault void write(com.esotericsoftware.kryo.Kryo kryo, com.esotericsoftware.kryo.io.Output output)
write
in interface com.esotericsoftware.kryo.KryoSerializable
kryo
- Kryo instanceoutput
- Output