Example usage for java.lang Boolean FALSE

List of usage examples for java.lang Boolean FALSE

Introduction

In this page you can find the example usage for java.lang Boolean FALSE.

Prototype

Boolean FALSE

To view the source code for java.lang Boolean FALSE.

Click Source Link

Document

The Boolean object corresponding to the primitive value false .

Usage

From source file:Main.java

/**
 * Helper method used to get default value for wrappers used for primitive types
 * (0 for Integer etc)// ww  w.ja  va  2s. c om
 */
public static Object defaultValue(Class<?> cls) {
    if (cls == Integer.TYPE) {
        return Integer.valueOf(0);
    }
    if (cls == Long.TYPE) {
        return Long.valueOf(0L);
    }
    if (cls == Boolean.TYPE) {
        return Boolean.FALSE;
    }
    if (cls == Double.TYPE) {
        return Double.valueOf(0.0);
    }
    if (cls == Float.TYPE) {
        return Float.valueOf(0.0f);
    }
    if (cls == Byte.TYPE) {
        return Byte.valueOf((byte) 0);
    }
    if (cls == Short.TYPE) {
        return Short.valueOf((short) 0);
    }
    if (cls == Character.TYPE) {
        return '\0';
    }
    throw new IllegalArgumentException("Class " + cls.getName() + " is not a primitive type");
}

From source file:Main.java

public static void disableToolBar(JToolBar panel, Class<?>... classesToIgnore) {
    for (Component component : panel.getComponents()) {
        if (!ignoreClasses(component, classesToIgnore)) {
            Method m = discover(component, "setEnabled", boolean.class);
            invoke(m, component, new Object[] { Boolean.FALSE });
        }//from ww w  .j av  a 2  s. c  o  m
    }
}

From source file:Main.java

/**
 * See if the user has added appcompat-v7 with AppCompatViews
 *
 * @return true if AppcompatTextView is on the classpath
 *///from ww  w  .  j av  a 2s .c  o  m
static boolean canAddV7AppCompatViews() {
    if (sAppCompatViewCheck == null) {
        try {
            Class.forName("android.support.v7.widget.AppCompatTextView");
            sAppCompatViewCheck = Boolean.TRUE;
        } catch (ClassNotFoundException e) {
            sAppCompatViewCheck = Boolean.FALSE;
        }
    }
    return sAppCompatViewCheck;
}

From source file:com.inkubator.hrm.util.StringsUtils.java

public static Boolean isHaveUpperCase(String str) {
    Boolean isCondition = Boolean.FALSE;
    for (int i = str.length() - 1; i >= 0; i--) {

        if (Character.isUpperCase(str.charAt(i))) {
            isCondition = Boolean.TRUE;
        }/*ww  w .j  av a  2 s  .  com*/
    }
    return isCondition;

}

From source file:Main.java

public static Document getDocumentFromString(String xmlString) throws Exception {
    DocumentBuilderFactory oDocumentBuilderFactory = DocumentBuilderFactory.newInstance();
    try {/*from ww  w . j  a va  2s . c o m*/
        // Do not load the DTD
        oDocumentBuilderFactory.setAttribute("http://apache.org/xml/features/nonvalidating/load-external-dtd",
                Boolean.FALSE);
    } catch (IllegalArgumentException e) {
    }
    DocumentBuilder oDocumentBuilder = oDocumentBuilderFactory.newDocumentBuilder();

    InputSource inputSource = new InputSource(new StringReader(xmlString));
    return oDocumentBuilder.parse(inputSource);
}

From source file:Main.java

/**
 * See if the user has added appcompat-v7, this is done at runtime, so we only check once.
 *
 * @return true if the v7.Toolbar is on the classpath
 *//* w  ww .  ja v  a  2s .  c  o  m*/
static boolean canCheckForV7Toolbar() {
    if (sToolbarCheck == null) {
        try {
            Class.forName("android.support.v7.widget.Toolbar");
            sToolbarCheck = Boolean.TRUE;
        } catch (ClassNotFoundException e) {
            sToolbarCheck = Boolean.FALSE;
        }
    }
    return sToolbarCheck;
}

From source file:Main.java

public static boolean isWhiteSpace(char c) {
    boolean out = Boolean.TRUE;
    for (Character cr : WHITE_SPACE) {
        if (cr.equals(c)) {
            out = Boolean.FALSE;
            break;
        }/*  ww w.j av  a 2 s.c om*/
    }
    return out;
}

From source file:Main.java

public static Boolean isEmpty(int[] arr) {
    if (arr == null || arr.length < 1) {
        return Boolean.TRUE;
    }//from   ww  w . j ava 2 s. co  m
    return Boolean.FALSE;
}

From source file:Main.java

public static void roChildren(JPanel panel, Class<?>... classesToIgnore) {
    for (Component component : panel.getComponents()) {
        if (component instanceof JPanel) {
            roChildren((JPanel) component, classesToIgnore);
        } else {// w w  w .j av a2s .  co m
            if (!ignoreClasses(component, classesToIgnore)) {
                Method m = discover(component, "setEditable", boolean.class);
                invoke(m, component, new Object[] { Boolean.FALSE });
            }
        }
    }
}

From source file:Main.java

/**
 * <p>Checks if a {@code Boolean} value is {@code false},
 * handling {@code null} by returning {@code false}.</p>
 * <p>//from   www  .j  av a 2s  . c o  m
 * <pre>
 *   BooleanUtils.isFalse(Boolean.TRUE)  = false
 *   BooleanUtils.isFalse(Boolean.FALSE) = true
 *   BooleanUtils.isFalse(null)          = false
 * </pre>
 *
 * @param bool the boolean to check, null returns {@code false}
 * @return {@code true} only if the input is non-null and false
 * @since 2.1
 */
public static boolean isFalse(final Boolean bool) {
    return Boolean.FALSE.equals(bool);
}