Package randoop.reflection
Class StaticCache
- java.lang.Object
-
- randoop.reflection.StaticCache
-
public class StaticCache extends Object
Stores the mutable state of a class, allowing it to be saved, printed and restored.
-
-
Constructor Summary
Constructors Constructor Description StaticCache(Class<?> declaringClass)
Creates the cache object for a particular class.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method 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.
-
-
-
Constructor Detail
-
StaticCache
public StaticCache(Class<?> declaringClass)
Creates the cache object for a particular class. State is not saved untilsaveState()
is called.- Parameters:
declaringClass
- the class
-
-
Method Detail
-
printCache
public void printCache()
Prints the fields and their values to standard output.
-
saveState
public void saveState()
Saves the state for the class in this object. Only saves non-final static fields.
-
restoreState
public void restoreState()
Restores the saved state of the class in this object to previously saved values.
-
-