public class SerializedEntityPool extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static int |
NULL_HANDLE
The handle representing the
null value. |
Constructor and Description |
---|
SerializedEntityPool() |
Modifier and Type | Method and Description |
---|---|
void |
assertAllPlainClassNamesMatch(java.util.function.Function<java.lang.String,java.lang.Boolean> matcher,
java.lang.String message)
Asserts that all serialized class names are matched by the given function.
|
boolean |
containsHandle(int handle)
Returns whether the given handle is known to this pool.
|
SerializedClass |
findClass(java.lang.String name)
Attempts to find a class by its name.
|
<T extends SerializedEntityBase> |
getEntities(java.lang.Class<T> expectedType)
Return all entities anywhere in the object graph of the given type.
|
<T extends SerializedEntityBase> |
getEntity(int handle,
java.lang.Class<T> expectedType)
Returns an entity of specific expected type.
|
java.util.List<SerializedEntityBase> |
getRootEntities()
Returns the root entities in this pool.
|
<T extends SerializedEntityBase> |
getRootEntities(java.lang.Class<T> expectedType)
Return all root entities of the given type.
|
void |
registerRootHandle(int handle)
Adds a handle as root.
|
void |
renameClass(java.lang.String oldName,
java.lang.String newName)
Renames the given class if found.
|
void |
reset()
Resets the pool to an empty state.
|
public static final int NULL_HANDLE
null
value.public SerializedEntityPool()
public void reset()
public boolean containsHandle(int handle)
public <T extends SerializedEntityBase> T getEntity(int handle, java.lang.Class<T> expectedType) throws java.io.IOException
java.io.IOException
public <T extends SerializedEntityBase> java.util.List<T> getEntities(java.lang.Class<T> expectedType) throws java.io.IOException
java.io.IOException
public <T extends SerializedEntityBase> java.util.List<T> getRootEntities(java.lang.Class<T> expectedType) throws java.io.IOException
java.io.IOException
public java.util.List<SerializedEntityBase> getRootEntities() throws java.io.IOException
java.io.IOException
public void registerRootHandle(int handle) throws java.io.IOException
java.io.IOException
public SerializedClass findClass(java.lang.String name)
public void renameClass(java.lang.String oldName, java.lang.String newName)
public void assertAllPlainClassNamesMatch(java.util.function.Function<java.lang.String,java.lang.Boolean> matcher, java.lang.String message)