franta-hg@1: package info.globalcode.sql.dk; franta-hg@1: franta-hg@1: import java.util.ArrayList; franta-hg@1: import java.util.Collection; franta-hg@1: import java.util.Collections; franta-hg@1: franta-hg@1: /** franta-hg@1: * franta-hg@1: * @author Ing. František Kučera (frantovo.cz) franta-hg@1: */ franta-hg@1: public class InvalidOptionsException extends Exception { franta-hg@1: franta-hg@1: private final Collection problems = new ArrayList<>(); franta-hg@1: franta-hg@1: public Collection getProblems() { franta-hg@1: return Collections.unmodifiableCollection(problems); franta-hg@1: } franta-hg@1: franta-hg@1: public void addProblem(OptionProblem p) { franta-hg@1: problems.add(p); franta-hg@1: } franta-hg@1: franta-hg@1: public boolean hasProblems() { franta-hg@1: return !problems.isEmpty(); franta-hg@1: } franta-hg@1: franta-hg@1: public static class OptionProblem { franta-hg@1: franta-hg@1: private String description; franta-hg@1: franta-hg@1: public OptionProblem(String description) { franta-hg@1: this.description = description; franta-hg@1: } franta-hg@1: franta-hg@1: public String getDescription() { franta-hg@1: return description; franta-hg@1: } franta-hg@1: } franta-hg@1: }