|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnl.jqno.equalsverifier.util.ClassAccessor<T>
T
- A class.public class ClassAccessor<T>
Instantiates and populates objects of a given class. ClassAccessor
can create two different instances of T, which are guaranteed not to be
equal to each other, and which contain no null values.
Method Summary | ||
---|---|---|
boolean |
declaresEquals()
Determines whether T has an equals method. |
|
boolean |
declaresField(Field field)
Determines whether T declares a field. |
|
boolean |
declaresHashCode()
Determines whether T has an hashCode method. |
|
boolean |
fieldHasAnnotation(Field field,
Annotation annotation)
Determines whether a particular field in T has a particular annotation. |
|
ObjectAccessor<T> |
getBlackAccessor()
Returns an ObjectAccessor for getBlackObject() . |
|
T |
getBlackObject()
Returns an instance of T that is not equal to the instance of T returned by getRedObject() . |
|
ObjectAccessor<T> |
getDefaultValuesAccessor()
Returns an ObjectAccessor for getDefaultValuesObject() . |
|
T |
getDefaultValuesObject()
Returns an instance of T where all the fields are initialized to their default values. |
|
PrefabValues |
getPrefabValues()
Getter. |
|
ObjectAccessor<T> |
getRedAccessor()
Returns an ObjectAccessor for getRedObject() . |
|
T |
getRedObject()
Returns an instance of T that is not equal to the instance of T returned by getBlackObject() . |
|
ClassAccessor<? super T> |
getSuperAccessor()
Returns an accessor for T's superclass. |
|
Class<T> |
getType()
Getter. |
|
boolean |
hasAnnotation(Annotation annotation)
Determines whether T has a particular annotation. |
|
boolean |
isEqualsAbstract()
Determines whether T's equals method is abstract. |
|
boolean |
isEqualsInheritedFromObject()
Determines whether T's equals method is inherited from
Object . |
|
boolean |
isHashCodeAbstract()
Determines whether T's hashCode method is abstract. |
|
static
|
of(Class<T> type,
PrefabValues prefabValues,
boolean ignoreAnnotationFailure)
Factory method. |
|
boolean |
outerClassHasAnnotation(Annotation annotation)
Determines whether any of T's outer classes, if they exist, have a particular annotation. |
|
boolean |
packageHasAnnotation(Annotation annotation)
Determines whether the package in which T resides has a particular annotation. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static <T> ClassAccessor<T> of(Class<T> type, PrefabValues prefabValues, boolean ignoreAnnotationFailure)
T
- The class on which ClassAccessor
operates.type
- The class on which ClassAccessor
operates. Should be
the same as T.prefabValues
- Prefabricated values with which to fill instantiated
objects.ignoreAnnotationFailure
- Ignore when processing annotations fails.
ClassAccessor
for T.public Class<T> getType()
public PrefabValues getPrefabValues()
public boolean hasAnnotation(Annotation annotation)
annotation
- The annotation we want to find.
public boolean outerClassHasAnnotation(Annotation annotation)
annotation
- The annotation we want to find.
public boolean packageHasAnnotation(Annotation annotation)
annotation
- The annotation we want to find.
public boolean fieldHasAnnotation(Field field, Annotation annotation)
field
- The field for which we want to know if it has the specified
annotation.annotation
- The annotation we want to find.
public boolean declaresField(Field field)
public boolean declaresEquals()
equals
method.
equals
method.public boolean declaresHashCode()
hashCode
method.
hashCode
method.public boolean isEqualsAbstract()
equals
method is abstract.
equals
method is abstract.public boolean isHashCodeAbstract()
hashCode
method is abstract.
hashCode
method is abstract.public boolean isEqualsInheritedFromObject()
equals
method is inherited from
Object
.
equals
method is inherited from
Object
; false if it is overridden in T or in any of its
superclasses (except Object
).public ClassAccessor<? super T> getSuperAccessor()
public T getRedObject()
getBlackObject()
.
public ObjectAccessor<T> getRedAccessor()
ObjectAccessor
for getRedObject()
.
ObjectAccessor
for getRedObject()
.public T getBlackObject()
getRedObject()
.
public ObjectAccessor<T> getBlackAccessor()
ObjectAccessor
for getBlackObject()
.
ObjectAccessor
for getBlackObject()
.public T getDefaultValuesObject()
public ObjectAccessor<T> getDefaultValuesAccessor()
ObjectAccessor
for getDefaultValuesObject()
.
ObjectAccessor
for getDefaultValuesObject()
.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |