nl.jqno.equalsverifier.util
Class FieldIterable

java.lang.Object
  extended by nl.jqno.equalsverifier.util.FieldIterable
All Implemented Interfaces:
Iterable<Field>

public class FieldIterable
extends Object
implements Iterable<Field>

Iterable to iterate over all declared fields in a class and, if needed, over all declared fields of its superclasses.

Author:
Jan Ouwens

Method Summary
 Iterator<Field> iterator()
          Returns an iterator over all declared fields of the class and all of its superclasses.
static FieldIterable of(Class<?> type)
          Factory method for a FieldIterator that iterates over all declared fields of type and over the declared fields of all of its superclasses.
static FieldIterable ofIgnoringSuper(Class<?> type)
          Factory method for a FieldIterator that iterates over all declared fields of type, but that ignores the declared fields of its superclasses.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

of

public static FieldIterable of(Class<?> type)
Factory method for a FieldIterator that iterates over all declared fields of type and over the declared fields of all of its superclasses.

Parameters:
type - The class that contains the fields over which to iterate.
Returns:
A FieldIterator.

ofIgnoringSuper

public static FieldIterable ofIgnoringSuper(Class<?> type)
Factory method for a FieldIterator that iterates over all declared fields of type, but that ignores the declared fields of its superclasses.

Parameters:
type - The class that contains the fields over which to iterate.
Returns:
A FieldIterator.

iterator

public Iterator<Field> iterator()
Returns an iterator over all declared fields of the class and all of its superclasses.

Specified by:
iterator in interface Iterable<Field>
Returns:
An iterator over all declared fields of the class and all of its superclasses.


Copyright © 2015. All Rights Reserved.