public interface ReferenceResolver
Modifier and Type | Method and Description |
---|---|
int |
addWrittenObject(Object object)
Returns a new ID for an object that is being written for the first time.
|
Object |
getReadObject(Class type,
int id)
Returns the object for the specified ID.
|
int |
getWrittenId(Object object)
Returns an ID for the object if it has been written previously, otherwise returns -1.
|
int |
nextReadId(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,
Object object)
Sets the ID for an object that has been read.
|
boolean |
useReferences(Class type)
Returns true if references will be written for the specified type.
|
void setKryo(Kryo kryo)
int getWrittenId(Object object)
int addWrittenObject(Object object)
int nextReadId(Class type)
type
- The type of object that will be read.void setReadObject(int id, Object object)
id
- The ID from nextReadId(Class)
.Object getReadObject(Class type, int id)
setReadObject(int, Object)
.void reset()
Kryo.reset()
.boolean useReferences(Class type)
type
- Will never be a primitive type, but may be a primitive type wrapper.Copyright © 2018. All rights reserved.