I need some tips on using Iterable<T> in Java.
I have the following class:
public abstract class Validator implements Comparable<Validator>{ public abstract boolean validate(); public abstract int getPriority(); @Override public int compareTo(Validator o) { return getPriority() > o.getPriority() ? -1 : getPriority() == o.getPriority() ? 0 : 1; } }
I need to create a ValidatorChain class as follows:
public class ValidatorChain{
Maybe I should just override some immediate implementation of Iterable<T> instead of writing my own from scratch.
user2953119
source share