public static boolean contains(Object[] array, Object object) { return indexOf( array, object ) > -1; }
private int getSubclassPropertyIndex(String propertyName) { return ArrayHelper.indexOf( subclassPropertyNameClosure, propertyName ); }
/** * Get the config value as a {@link String}. * * @param name The config setting name. * @param values The map of config parameters. * @param defaultValue The default value to use if not found. * @param otherSupportedValues List of other supported values. Does not need to contain the default one. * * @return The value. * * @throws ConfigurationException Unsupported value provided. * */ public static String getString(String name, Map values, String defaultValue, String ... otherSupportedValues) { final String value = getString( name, values, defaultValue ); if ( !defaultValue.equals( value ) && ArrayHelper.indexOf( otherSupportedValues, value ) == -1 ) { throw new ConfigurationException( "Unsupported configuration [name=" + name + ", value=" + value + "]. " + "Choose value between: '" + defaultValue + "', '" + String.join( "', '", otherSupportedValues ) + "'." ); } return value; }
int index = ArrayHelper.indexOf( getSubclassPropertyNameClosure(), rootPropertyName
private int getSubclassPropertyIndex(String propertyName) { return ArrayHelper.indexOf(subclassPropertyNameClosure, propertyName); }
public static boolean contains(Object[] array, Object object) { return indexOf( array, object ) > -1; }
private int getSubclassPropertyIndex(String propertyName) { return ArrayHelper.indexOf(subclassPropertyNameClosure, propertyName); }
/** * Get the config value as a {@link String}. * * @param name The config setting name. * @param values The map of config parameters. * @param defaultValue The default value to use if not found. * @param otherSupportedValues List of other supported values. Does not need to contain the default one. * * @return The value. * * @throws ConfigurationException Unsupported value provided. * */ public static String getString(String name, Map values, String defaultValue, String ... otherSupportedValues) { final String value = getString( name, values, defaultValue ); if ( !defaultValue.equals( value ) && ArrayHelper.indexOf( otherSupportedValues, value ) == -1 ) { throw new ConfigurationException( "Unsupported configuration [name=" + name + ", value=" + value + "]. " + "Choose value between: '" + defaultValue + "', '" + String.join( "', '", otherSupportedValues ) + "'." ); } return value; }
int index = ArrayHelper.indexOf( getSubclassPropertyNameClosure(), rootPropertyName); //TODO: optimize this better! return index==-1 ? 0 : getSubclassPropertyTableNumber(index);
int index = ArrayHelper.indexOf( getSubclassPropertyNameClosure(), rootPropertyName); //TODO: optimize this better! return index==-1 ? 0 : getSubclassPropertyTableNumber(index);