public interface FieldTrait extends TypeTrait, MemberTrait<Field>, AnnotationTrait<Field>
| Modifier and Type | Method and Description |
|---|---|
default void |
destroy(Object instance)
Destroy the field for the given instance if it is annotated with
Fixture. |
default Field |
getAnnotatedElement()
Get the field as the annotated element.
|
default <T> Optional<T> |
getValue(Object instance)
Get the field value for the given instance.
|
default void |
init(Object instance)
Initialize the field for the given instance if it is annotated with
Fixture. |
default void |
setValue(Object instance,
Object value)
Set the field value for the given instance to the given value.
|
findMethod, findMethod, getClassLoader, getGenericType, getType, getTypeName, invoke, isSubtypeOf, isSupertypeOfgetDeclaringClass, getDeclaringClassLoader, getDeclaringClassName, getMember, getNamegetAnnotation, getAnnotations, getMetaAnnotations, hasAnyAnnotations, hasAnyAnnotationsdefault Field getAnnotatedElement()
getAnnotatedElement in interface AnnotationTrait<Field>default void setValue(Object instance, Object value)
instance - the instance whose field should be modifiedvalue - the new value for the field of instance being modifieddefault <T> Optional<T> getValue(Object instance)
T - the value typeinstance - the instance whose field value will be retrieveddefault void init(Object instance)
Fixture.instance - the instance whose field value will be retrievedCopyright © 2016–2018 Testify Project. All rights reserved.