T
- the generic type of the field.public class FieldTypeRef<T> extends Object
The following is an example of proper usage of this class:
// Retrieves the value of the field "powers" List<String> powers =field
("powers").ofType
(newTypeRef
<List<String>>() {}).in
(jedi).get
(); // Sets the value of the field "powers" List<String> powers = new ArrayList<String>(); powers.add("heal");field
("powers").ofType
(newTypeRef
<List<String>>() {}).in
(jedi).set
(powers);
public Invoker<T> in(Object target)
target
- the object containing the field of interest.NullPointerException
- if the given target is null
.ReflectionError
- if a field with a matching name and type cannot be found.Copyright © 2007-2012 FEST (Fixtures for Easy Software Testing). All Rights Reserved.