public static boolean isExplicitlyRequested ( String candidate , String ... indices ) { boolean result = false ; for ( String indexOrAlias : indices ) { boolean include = true ; if ( indexOrAlias . charAt ( 0 ) == ' ' || indexOrAlias . charAt ( 0 ) == ' ' ) { include = indexOrAlias . charAt ( 0 ) == ' ' ; indexOrAlias = indexOrAlias . substring ( 1 ) ; } if ( indexOrAlias . equals ( "*" ) || indexOrAlias . equals ( "_all" ) ) { return false ; } if ( Regex . isSimpleMatchPattern ( indexOrAlias ) ) { if ( Regex . simpleMatch ( indexOrAlias , candidate ) ) { if ( include ) { result = true ; } else { return false ; } } } else { if ( candidate . equals ( indexOrAlias ) ) { if ( include ) { result = true ; } else { return false ; } } } } return result ; }
Checks if the provided candidate is explicitly contained in the provided indices .