@ SuppressWarnings ( "all" ) @ NullSafe public static boolean or ( Boolean ... values ) { boolean result = false ; // guilty until proven innocent for ( Boolean value : nullSafeArray ( values , Boolean . class ) ) { result |= valueOf ( value ) ; if ( result ) { // short-circuit if we find a true value break ; } } return result ; }
Performs a logical OR on all the Boolean values and returns true if just one Boolean value evaluates to true as determined by the BooleanUtils . valueOf method on the Boolean wrapper object . If the Boolean array is null the result of the OR operation is false .