public interface ReferenceResolver
Modifier and Type | Method and Description |
---|---|
int |
addWrittenObject(java.lang.Object object)
Returns a new ID for an object that is being written for the first time.
|
java.lang.Object |
getReadObject(java.lang.Class type,
int id)
Returns the object for the specified ID.
|
int |
getWrittenId(java.lang.Object object)
Returns an ID for the object if it has been written previously, otherwise returns -1.
|
int |
nextReadId(java.lang.Class type)
Reserves the ID for the next object that will be read.
|
void |
reset()
Called by
Kryo.reset() . |
void |
setKryo(Kryo kryo)
Sets the Kryo instance that this ClassResolver will be used for.
|
void |
setReadObject(int id,
java.lang.Object object)
Sets the ID for an object that has been read.
|
boolean |
useReferences(java.lang.Class type)
Returns true if references will be written for the specified type.
|
void setKryo(Kryo kryo)
int getWrittenId(java.lang.Object object)
int addWrittenObject(java.lang.Object object)
int nextReadId(java.lang.Class type)
type
- The type of object that will be read.void setReadObject(int id, java.lang.Object object)
id
- The ID from nextReadId(Class)
.java.lang.Object getReadObject(java.lang.Class type, int id)
setReadObject(int, Object)
.void reset()
Kryo.reset()
.boolean useReferences(java.lang.Class type)
type
- Will never be a primitive type, but may be a primitive type wrapper.