Below is a sample, getErrors()
and getWarnings()
return List<T>
public interface ErrorHolder<T> {
public void addError(T t);
public int totalErrors();
public boolean hasErrors();
public void addWarning(T t);
public int totalWarnings();
public boolean hasWarnings();
public List<T> getErrors();
public List<T> getWarnings();
}
and in the implementing class -
private List<T> errors = new ArrayList<T>();
public void addError(T t) {
errors.add(t);
}
public List<T> getErrors() {
return errors;
}