Accessing Static Fields
We will use an example to better understand FEST-Reflect's fluent interface for static field access.
Let's assume we have a simple class Person that defines the following field:
class Person {
private static int count;
}
The following sections illustrate static field access using FEST-Reflect. We are going to assume the following static import:
import static org.fest.reflect.core.Reflection.staticField;
Reading the value of a static field
int count = staticField("count").ofType(int. class) .in(Person.class) .get();
Setting the value of a field
staticField("count").ofType(int.class) .in(Person.class) .set(8);
