/** * Add all the entries of a map. Any keys of the map which are not valid {@link Option}s, or whose * values are not valid arguments for the given {@code Option}, will cause an exception to be thrown. * Any keys which occur more than once in this builder will be overwritten with the last occurring value. * * @param map the map * @return this builder * @throws ClassCastException if any entries of the map are not valid option-value pairs */ public Builder add(Map<?, ?> map) throws ClassCastException { for (Object key : map.keySet()) { final Option<?> option = Option.class.cast(key); copy(map, option); } return this; }
/** * Add all the entries of a map. Any keys of the map which are not valid {@link Option}s, or whose * values are not valid arguments for the given {@code Option}, will cause an exception to be thrown. * Any keys which occur more than once in this builder will be overwritten with the last occurring value. * * @param map the map * @return this builder * @throws ClassCastException if any entries of the map are not valid option-value pairs */ public Builder add(Map<?, ?> map) throws ClassCastException { for (Object key : map.keySet()) { final Option<?> option = Option.class.cast(key); copy(map, option); } return this; }
/** * Add all entries from an existing option map to the one being built. * Any keys which occur more than once in this builder will be overwritten with the last occurring value. * * @param optionMap the original option map * @return this builder */ public Builder addAll(OptionMap optionMap) { for (Option<?> option : optionMap) { copy(optionMap, option); } return this; }
/** * Add all entries from an existing option map to the one being built. * Any keys which occur more than once in this builder will be overwritten with the last occurring value. * * @param optionMap the original option map * @return this builder */ public Builder addAll(OptionMap optionMap) { for (Option<?> option : optionMap) { copy(optionMap, option); } return this; }