Example usage for java.lang Boolean booleanValue

List of usage examples for java.lang Boolean booleanValue

Introduction

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

Prototype

@HotSpotIntrinsicCandidate
public boolean booleanValue() 

Source Link

Document

Returns the value of this Boolean object as a boolean primitive.

Usage

From source file:MainClass.java

public static void main(String[] args) {
    boolean b = true;
    Boolean b2 = new Boolean(b);
    System.out.println(b2.booleanValue());
}

From source file:Main.java

public static void main(String[] args) {
    Boolean blnObj = new Boolean("true");
    boolean b = blnObj.booleanValue();
    System.out.println(b);/*  www. j  a va2s. co  m*/
}

From source file:Main.java

public static void main(String[] args) {
    Boolean boolean1 = new Boolean("true");
    System.out.println(boolean1.booleanValue());

}

From source file:Main.java

public static void main(String[] argv) throws Exception {
    Boolean refBoolean = new Boolean(true);
    boolean bool = refBoolean.booleanValue();

    Byte refByte = new Byte((byte) 123);
    byte b = refByte.byteValue();

    Character refChar = new Character('x');
    char c = refChar.charValue();

    Short refShort = new Short((short) 123);
    short s = refShort.shortValue();

    Integer refInt = new Integer(123);
    int i = refInt.intValue();

    Long refLong = new Long(123L);
    long l = refLong.longValue();

    Float refFloat = new Float(12.3F);
    float f = refFloat.floatValue();

    Double refDouble = new Double(12.3D);
    double d = refDouble.doubleValue();
}

From source file:MainClass.java

public static void main(String[] args) {
    Boolean b1 = new Boolean(false);
    Boolean b2 = new Boolean("true");

    System.out.println(b1.booleanValue());
    System.out.println(b2.booleanValue());
}

From source file:com.boonya.http.async.examples.nio.client.AsyncClientHttpExchangeStreaming.java

public static void main(final String[] args) throws Exception {
    CloseableHttpAsyncClient httpclient = HttpAsyncClients.createDefault();
    try {//from   www  .  ja  va  2  s  .  co  m
        httpclient.start();
        Future<Boolean> future = httpclient.execute(HttpAsyncMethods.createGet("http://localhost:8080/"),
                new MyResponseConsumer(), null);
        Boolean result = future.get();
        if (result != null && result.booleanValue()) {
            System.out.println("Request successfully executed");
        } else {
            System.out.println("Request failed");
        }
        System.out.println("Shutting down");
    } finally {
        httpclient.close();
    }
    System.out.println("Done");
}

From source file:com.meidusa.venus.benchmark.venus.VenusBenchmark.java

public static void main(String[] args) throws Exception {
    try {/* ww w .j  a va2 s. c o m*/
        parser.parse(args);
        Boolean value = (Boolean) parser.getOptionValue(helpOption, false);
        if (value != null && value.booleanValue()) {
            parser.printUsage();
            System.exit(2);
        }
        parser.checkRequired();
    } catch (CmdLineParser.OptionException e) {
        System.err.println(e.getMessage());
        parser.printUsage();
        System.exit(2);
    }

    AbstractBenchmark.setBenchmark(new VenusBenchmark());
    AbstractBenchmark.main(args);
}

From source file:Main.java

public static void main(String[] args) {
    // Using constructors
    Boolean b1True = new Boolean(true);
    Boolean b2True = new Boolean("true");
    Boolean b3True = new Boolean("tRuE");
    Boolean b4False = new Boolean("false");
    Boolean b5False = new Boolean("how  is this"); // false

    // Using the factory methods
    Boolean b6True = Boolean.valueOf(true);
    Boolean b7True = Boolean.valueOf("true");
    Boolean b8True = Boolean.valueOf("tRuE");
    Boolean b9False = Boolean.valueOf("false");
    Boolean b10False = Boolean.valueOf("how is this"); // false

    // Getting a boolean value from a Boolean object
    boolean bbTrue = b8True.booleanValue();

    boolean bTrue = Boolean.parseBoolean("true");
    boolean bFalse = Boolean.parseBoolean("This string evaluates to false");

    Boolean bcTrue = Boolean.TRUE;
    Boolean bcFalse = Boolean.FALSE;

    System.out.println("bcTrue = " + bcTrue);
    System.out.println("bcFalse = " + bcFalse);
}

From source file:Main.java

public static void main(String[] args) {
    Month month = Month.valueOf("MARCH");

    int day = 10;
    LocalDate date = LocalDate.of(Year.now().getValue(), month, day);

    // Invoking the query without using a lambda expression.
    Boolean isFamilyVacation = date.query(new FamilyVacations());

    // Invoking the query using a lambda expression.
    Boolean isFamilyBirthday = date.query(FamilyBirthdays::isFamilyBirthday);

    if (isFamilyVacation.booleanValue() || isFamilyBirthday.booleanValue())
        System.out.printf("%s is an important date!%n", date);
    else/* w  w  w.  j av  a  2 s  .c  o  m*/
        System.out.printf("%s is not an important date.%n", date);
}

From source file:edu.internet2.middleware.shibboleth.common.attribute.AttributeAuthorityCLI.java

/**
 * Runs this application. Help message prints if no arguments are given or if the "help" argument is given.
 * //  w w w .j a v a  2 s.  c om
 * @param args command line arguments
 * 
 * @throws Exception thrown if there is a problem during program execution
 */
public static void main(String[] args) throws Exception {
    CmdLineParser parser = parseCommandArguments(args);
    ApplicationContext appCtx = loadConfigurations(
            (String) parser.getOptionValue(CLIParserBuilder.CONFIG_DIR_ARG),
            (String) parser.getOptionValue(CLIParserBuilder.SPRING_EXTS_ARG));

    saml1AA = (SAML1AttributeAuthority) appCtx.getBean("shibboleth.SAML1AttributeAuthority");
    saml2AA = (SAML2AttributeAuthority) appCtx.getBean("shibboleth.SAML2AttributeAuthority");

    SAMLObject attributeStatement;
    Boolean saml1 = (Boolean) parser.getOptionValue(CLIParserBuilder.SAML1_ARG, Boolean.FALSE);
    if (saml1.booleanValue()) {
        protocol = SAMLConstants.SAML11P_NS;
        attributeStatement = performSAML1AttributeResolution(parser, appCtx);
    } else {
        protocol = SAMLConstants.SAML20P_NS;
        attributeStatement = performSAML2AttributeResolution(parser, appCtx);
    }

    printAttributeStatement(attributeStatement);
}