public class StaticCache
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
private java.lang.Class<?> |
declaringClass
The class for which static state is to be saved.
|
private java.util.Map<java.lang.reflect.Field,java.lang.Object> |
valueMap
The map from static fields to a value.
|
| Constructor and Description |
|---|
StaticCache(java.lang.Class<?> declaringClass)
Creates the cache object for a particular class.
|
| Modifier and Type | Method and Description |
|---|---|
void |
printCache()
Prints the fields and their values to standard output.
|
void |
restoreState()
Restores the saved state of the class in this object to previously saved values.
|
void |
saveState()
Saves the state for the class in this object.
|
private final java.lang.Class<?> declaringClass
private final java.util.Map<java.lang.reflect.Field,java.lang.Object> valueMap
public StaticCache(java.lang.Class<?> declaringClass)
saveState()
is called.declaringClass - the classpublic void printCache()
public void saveState()
public void restoreState()