/** * Gets the integer value of an option assumed to be an {@link IntegerExportOption}. * * @param className The name of the class of the option to get the value of. * @return If this set of options contains the requested option, returns its integer value; zero * otherwise. * @throws ClassCastException if the requested option is not an {@link IntegerExportOption}. * @see #getOption(String) * @see #setIntValueOf(String,int) */ public final int getIntValueOf(String className) { final IntegerExportOption option = (IntegerExportOption) getOption(fixClassName(className)); return option != null ? option.getValue() : 0; }
/** * Sets the integer value of an option assumed to be an {@link IntegerExportOption}. * * @param className The name of the class of the option to set the value of. * @param newValue The new value. * @throws ClassCastException if the requested option is not an {@link IntegerExportOption}. * @throws IllegalArgumentException if there is no option having the given class name. * @see #getIntValueOf(String) * @see #setValueOf(String,String) */ public final void setIntValueOf(String className, int newValue) { final IntegerExportOption option = (IntegerExportOption) getOption(fixClassName(className)); if (option == null) throw new IllegalArgumentException(className); option.setValue(newValue); }