Java Array Value Any anyIsTrue(Boolean... conditions)

Here you can find the source of anyIsTrue(Boolean... conditions)

Description

Indicates whether any of the given conditions are not null and true.

License

Open Source License

Parameter

Parameter Description
conditions the conditions.

Return

whether any of the given conditions are not null and true.

Declaration

public static final boolean anyIsTrue(Boolean... conditions) 

Method Source Code

//package com.java2s;

public class Main {
    /**/*from ww  w.  j a v a  2  s.c o  m*/
     * Indicates whether any of the given conditions are not null and true.
     * 
     * @param conditions the conditions.
     * @return whether any of the given conditions are not null and true.
     */
    public static final boolean anyIsTrue(Boolean... conditions) {
        if (conditions != null) {
            for (Boolean condition : conditions) {
                if (condition != null && condition.booleanValue()) {
                    return true;
                }
            }
        }

        return false;
    }
}

Related

  1. anyEmpty(String[] array)
  2. anyEmptyField(String[] items)
  3. anyEqual(int item, int... expected)
  4. anyInherit(Class cl, Class[] otherClasses)
  5. anyInstance(Throwable t, Class[] types)
  6. anyMore(int[] target, int[] test)
  7. anyNoneNull(String... arrays)
  8. anyNotNull(final Object... values)
  9. anyNotNull(Object... tests)