/** * Programmatically defines an option (instead of reading it from annotations as normal). * * @param setter the setter for the type * @param o the {@code Option} * @throws NullPointerException if {@code setter} or {@code o} is {@code null}. * @throws IllegalAnnotationError if the option name or one of the aliases is already taken. */ public void addOption(Setter setter, Option o) { checkNonNull(setter, "Setter"); checkNonNull(o, "Option"); checkOptionNotInMap(o.name()); for (String alias : o.aliases()) { checkOptionNotInMap(alias); } options.add(createOptionHandler(new NamedOptionDef(o), setter)); }
/** * Programmatically defines an option (instead of reading it from annotations as normal). * * @param setter the setter for the type * @param o the {@code Option} * @throws NullPointerException if {@code setter} or {@code o} is {@code null}. * @throws IllegalAnnotationError if the option name or one of the aliases is already taken. */ public void addOption(Setter setter, Option o) { checkNonNull(setter, "Setter"); checkNonNull(o, "Option"); checkOptionNotInMap(o.name()); for (String alias : o.aliases()) { checkOptionNotInMap(alias); } options.add(createOptionHandler(new NamedOptionDef(o), setter)); }
/** * Programmatically defines an option (instead of reading it from annotations as normal). * * @param setter the setter for the type * @param o the {@code Option} * @throws NullPointerException if {@code setter} or {@code o} is {@code null}. * @throws IllegalAnnotationError if the option name or one of the aliases is already taken. */ public void addOption(Setter setter, Option o) { checkNonNull(setter, "Setter"); checkNonNull(o, "Option"); checkOptionNotInMap(o.name()); for (String alias : o.aliases()) { checkOptionNotInMap(alias); } options.add(createOptionHandler(new NamedOptionDef(o), setter)); }
/** * Programmatically defines an option (instead of reading it from annotations as normal). * * @param setter the setter for the type * @param o the {@code Option} * @throws NullPointerException if {@code setter} or {@code o} is {@code null}. * @throws IllegalAnnotationError if the option name or one of the aliases is already taken. */ public void addOption(Setter setter, Option o) { checkNonNull(setter, "Setter"); checkNonNull(o, "Option"); checkOptionNotInMap(o.name()); for (String alias : o.aliases()) { checkOptionNotInMap(alias); } options.add(createOptionHandler(new NamedOptionDef(o), setter)); }