Module nl.jqno.equalsverifier
Class FieldIterable
java.lang.Object
nl.jqno.equalsverifier.internal.reflection.FieldIterable
- All Implemented Interfaces:
Iterable<FieldProbe>
Iterable to iterate over all declared fields in a class and, if needed, over all declared fields of its superclasses.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final booleanprivate final booleanprivate final booleanprivate final Class<?> -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateFieldIterable(Class<?> type, boolean includeSuperclasses, boolean includeStatic, boolean isKotlin) Private constructor. -
Method Summary
Modifier and TypeMethodDescriptionprivate List<FieldProbe> addFieldsFor(Class<?> c) private List<FieldProbe> private List<FieldProbe> private List<FieldProbe> iterator()Returns an iterator over all declared fields of the class and all of its superclasses.static FieldIterableFactory method for a FieldIterable that iterates over all declared fields oftypeand over the declared fields of all of its superclasses.static FieldIterableofIgnoringStatic(Class<?> type) Factory method for a FieldIterable that iterates over all declared fields oftype, but that ignores its static fields.static FieldIterableofIgnoringSuper(Class<?> type) Factory method for a FieldIterable that iterates over all declared fields oftype, but that ignores the declared fields of its superclasses.static FieldIterableofIgnoringSuperAndStatic(Class<?> type) Factory method for a FieldIterable that iterates over all declared fields oftype, but that ignores its the declared fields of its superclasses, as well as its static fields.static FieldIterableFactory method for a FieldIterable that iterates over all declared fields oftypeand over the declared fields of all of its superclasses, but that ignores overridden Kotlin backing fields in superclasses.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Field Details
-
type
-
includeSuperclasses
private final boolean includeSuperclasses -
includeStatic
private final boolean includeStatic -
isKotlin
private final boolean isKotlin
-
-
Constructor Details
-
FieldIterable
private FieldIterable(Class<?> type, boolean includeSuperclasses, boolean includeStatic, boolean isKotlin) Private constructor. Callof(Class)orofIgnoringSuper(Class)instead.
-
-
Method Details
-
of
Factory method for a FieldIterable that iterates over all declared fields oftypeand over the declared fields of all of its superclasses.- Parameters:
type- The class that contains the fields over which to iterate.- Returns:
- A FieldIterable.
-
ofKotlin
Factory method for a FieldIterable that iterates over all declared fields oftypeand over the declared fields of all of its superclasses, but that ignores overridden Kotlin backing fields in superclasses.- Parameters:
type- The class that contains the fields over which to iterate.- Returns:
- A FieldIterable.
-
ofIgnoringSuper
Factory method for a FieldIterable that iterates over all declared fields oftype, but that ignores the declared fields of its superclasses.- Parameters:
type- The class that contains the fields over which to iterate.- Returns:
- A FieldIterable.
-
ofIgnoringStatic
Factory method for a FieldIterable that iterates over all declared fields oftype, but that ignores its static fields.- Parameters:
type- The class that contains the fields over which to iterate.- Returns:
- A FieldIterable.
-
ofIgnoringSuperAndStatic
Factory method for a FieldIterable that iterates over all declared fields oftype, but that ignores its the declared fields of its superclasses, as well as its static fields.- Parameters:
type- The class that contains the fields over which to iterate.- Returns:
- A FieldIterable.
-
iterator
Returns an iterator over all declared fields of the class and all of its superclasses.- Specified by:
iteratorin interfaceIterable<FieldProbe>- Returns:
- An iterator over all declared fields of the class and all of its superclasses.
-
createFieldList
-
createJavaFieldList
-
createKotlinFieldList
-
addFieldsFor
-