public class FieldValues
extends Object
This utility is meant to be used to replace direct calls to private field variables in class invariants.
| Type Params | Return Type | Name and description |
|---|---|---|
<T> |
public static T |
fieldValue(Object obj, String fieldName, Class<T> type)Reads a field value reflectively from the target object wrapped by a generated closure instance. |
Reads a field value reflectively from the target object wrapped by a generated closure instance.
obj - the generated closure instancefieldName - the field name to read from the wrapped target objecttype - the expected field typeT - the result type