/** * Checks if the array contains the string <code>value</code>. This method is case insensitive. * * @param target * array to check if it contains <code>value</code> * @param value * string to check if it within the array * @return true if passed array contains value */ public static boolean contains( String[] target, String value ) { return contains( target, value, false, true ); }
/** * * @param id * @param caseSensitive * @param exact * @return true if the given id is present in this objects id's. */ public boolean hasId( String id, boolean caseSensitive, boolean exact ) { return contains( getOrignalCodeStrings(), id, caseSensitive, exact ); }
/** * Iterates over all Ids (code type originals) and Names and tests if either one matches the given string. * * @param idOrName * a String which might be an id or a name. * @param caseSensitive * should the match me case sensitive * @param exact * should the names and ids contain the given string or match exact. * @return true if any of the names or codes match without case the given string. */ public boolean hasIdOrName( String idOrName, boolean caseSensitive, boolean exact ) { return ArrayUtils.contains( getOrignalCodeStrings(), idOrName, caseSensitive, exact ) || ArrayUtils.contains( getNames(), idOrName, caseSensitive, exact ); }
if ( !ArrayUtils.contains( profile.getSupportedServiceNames(), serviceAttr ) ) { StringBuilder sb = new StringBuilder(); sb.append( "Wrong service attribute: '" ).append( serviceAttr );