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:org.mwc.debrief.track_shift.views.BearingResidualsView.java

@Override
public void init(final IViewSite site, final IMemento memento) throws PartInitException {
    super.init(site, memento);

    if (memento != null) {

        final Boolean doCourse = memento.getBoolean(SHOW_COURSE);
        if (doCourse != null)
            showCourse.setChecked(doCourse.booleanValue());
    }//  ww w .  j  av a  2s  . c  o  m
}

From source file:org.aludratest.service.gui.web.selenium.httpproxy.RequestProcessorThread.java

/** The {@link Thread}'s worker method which processes the request. */
@Override/*from  w ww  .  ja  v a 2s .c o  m*/
public void run() {
    LOGGER.debug("New request processor thread");

    // Create context and bind connection objects to the execution context
    HttpContext context = new BasicHttpContext(null);
    context.setAttribute(HTTP_IN_CONN, this.inconn);
    context.setAttribute(HTTP_OUT_CONN, this.outconn);

    // checking request's keep-alive attribute
    Boolean keepAliveObj = (Boolean) context.getAttribute(HTTP_CONN_KEEPALIVE);
    boolean keepAlive = (keepAliveObj != null && keepAliveObj.booleanValue());

    // handle in/out character transfer according to keep-alive setting
    try {
        while (!Thread.interrupted()) {
            if (!this.inconn.isOpen()) {
                this.outconn.close();
                break;
            }
            LOGGER.debug("Handling request");

            this.httpservice.handleRequest(this.inconn, context);

            if (!keepAlive) {
                this.outconn.close();
                this.inconn.close();
                LOGGER.debug("Finishing request");
                break;
            }
        }
    } catch (ConnectionClosedException ex) {
        if (keepAlive && owner.isRunning()) {
            LOGGER.error("Client closed connection");
        } else {
            LOGGER.debug("Client closed connection");
        }
    } catch (IOException ex) {
        LOGGER.error("I/O error: " + ex.getMessage());
    } catch (HttpException ex) {
        LOGGER.error("Unrecoverable HTTP protocol violation: " + ex.getMessage());
    } finally {
        try {
            this.inconn.shutdown();
        } catch (IOException ignore) {
            // ignore possible exceptions
        }
        try {
            this.outconn.shutdown();
        } catch (IOException ignore) {
            // ignore possible exceptions
        }
        LOGGER.debug("Finished connection thread");
    }
}

From source file:com.aurel.track.fieldType.runtime.matchers.run.CustomSelectMatcherRT.java

/**
 * Whether the value matches or not//from   w  w w.  j  av a2  s  . c  o m
 * @param attributeValue
 * @return
 */
@Override
public boolean match(Object attributeValue) {
    Boolean nullMatch = nullMatcher(attributeValue);
    if (nullMatch != null) {
        return nullMatch.booleanValue();
    }
    if (attributeValue == null || matchValue == null) {
        return false;
    }
    Object[] attributeValueCustomOption = null;
    Integer[] matcherValueCustomOption = null;
    try {
        attributeValueCustomOption = (Object[]) attributeValue;
    } catch (Exception e) {
        LOGGER.warn("Converting the attribute value " + attributeValue + " of type "
                + attributeValue.getClass().getName() + " to Object[] failed with " + e.getMessage());
        LOGGER.debug(ExceptionUtils.getStackTrace(e));
        return false;
    }
    try {
        matcherValueCustomOption = (Integer[]) matchValue;
    } catch (Exception e) {
        LOGGER.warn("Converting the matcher value " + matchValue + " of type " + matchValue.getClass().getName()
                + " to Integer[] failed with " + e.getMessage());
        LOGGER.debug(ExceptionUtils.getStackTrace(e));
        return false;
    }

    if (attributeValueCustomOption.length == 0) {
        //attributeValueCustomOption should have at least one element but could have more
        return false;
    }
    if (matcherValueCustomOption == null || matcherValueCustomOption.length == 0) {
        //matcherValueCustomOption should have one element
        return false;
    }

    switch (relation) {
    case MatchRelations.EQUAL:
        return containsValue(matcherValueCustomOption, attributeValueCustomOption);
    case MatchRelations.NOT_EQUAL:
        return !containsValue(matcherValueCustomOption, attributeValueCustomOption);
    default:
        return false;
    }
}

From source file:com.esri.core.geometry.JsonValueReader.java

private void setCurrentToken_(Object obj) {
    if (obj instanceof String) {
        m_currentToken = JsonToken.VALUE_STRING;
    } else if (obj instanceof Double || obj instanceof Float) {
        m_currentToken = JsonToken.VALUE_NUMBER_FLOAT;
    } else if (obj instanceof Integer || obj instanceof Long || obj instanceof Short) {
        m_currentToken = JsonToken.VALUE_NUMBER_INT;
    } else if (obj instanceof Boolean) {
        Boolean bObj = (Boolean) obj;
        boolean b = bObj.booleanValue();
        if (b) {/*ww w .ja  v  a  2s.  c  o m*/
            m_currentToken = JsonToken.VALUE_TRUE;
        } else {
            m_currentToken = JsonToken.VALUE_FALSE;
        }
    } else if (obj instanceof JSONObject) {
        m_currentToken = JsonToken.START_OBJECT;
    } else if (obj instanceof JSONArray) {
        m_currentToken = JsonToken.START_ARRAY;
    } else {
        m_currentToken = JsonToken.VALUE_NULL;
    }
}

From source file:com.kelveden.karma.AbstractStartMojo.java

protected List<String> valueToKarmaArgument(final Boolean value, final String trueSwitch,
        final String falseSwitch) {
    if (value == null) {
        return Collections.EMPTY_LIST;
    }//w w  w. j  a v  a 2 s.  com

    if (value.booleanValue()) {
        return Arrays.asList(trueSwitch);
    } else {
        return Arrays.asList(falseSwitch);
    }
}

From source file:org.iwethey.forums.web.user.UserController.java

/**
 * Toggle binary settings. Requires a request parameter of "toggle" 
 * that contains the name of the property to toggle.
 *///from  ww  w  .j a  va 2  s. co m
public ModelAndView toggle(HttpServletRequest request, HttpServletResponse response)
        throws ServletException, IOException {
    User user = (User) request.getAttribute(USER_ATTRIBUTE);

    String propName = RequestUtils.getStringParameter(request, "toggle", null);
    if (user != null && propName != null && !propName.equals("")) {
        BeanWrapper wrap = new BeanWrapperImpl(user);
        Boolean val = (Boolean) wrap.getPropertyValue(propName);

        wrap.setPropertyValue(propName, new Boolean(!val.booleanValue()));
        userManager.saveUserAttributes(user);
    }

    return new ModelAndView(new RedirectView(request.getHeader("referer")));
}

From source file:com.msp.jsvc.JRubyDaemon.java

private void checkDaemon() {
    // check it has come up OK
    Boolean wasSetup = (Boolean) JavaEmbedUtils.rubyToJava(runtime, daemon.callMethod("setup?"), Boolean.class);

    if (!wasSetup.booleanValue()) {
        throw new RuntimeException(
                "Daemon script did not call " + daemonName() + ".setup - can't tell if init succeeded.");
    }//  ww  w  .j a  v a  2 s .  co  m

}

From source file:gov.nih.nci.cabig.caaers.web.ae.ReviewAndReportResult.java

public boolean isManuallySelected(ReportDefinition rd) {
    Boolean b = manualSelectionIndicatorMap.get(rd.getId());
    if (b == null)
        return false;
    return b.booleanValue();
}

From source file:net.sourceforge.msscodefactory.cfbam.v2_7.CFBamMssCF.CFBamMssCFBindBoolDefInitValue.java

public String expandBody(MssCFGenContext genContext) {
    final String S_ProcName = "CFBamMssCFBindBoolDefInitValue.expandBody() ";

    if (genContext == null) {
        throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), "expandBody", 1,
                "genContext");
    }/*from ww  w.j a  va  2  s . c  o  m*/

    ICFLibAnyObj genDef = genContext.getGenDef();
    if (genDef == null) {
        throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), "expandBody", 1,
                "genContext.getGenDef()");
    }

    String ret;

    if (genDef instanceof ICFBamBoolDefObj) {
        Boolean initValue = ((ICFBamBoolDefObj) genDef).getOptionalInitValue();
        if (initValue == null) {
            ret = null;
        } else if (initValue.booleanValue()) {
            ret = "yes";
        } else {
            ret = "no";
        }
    } else {
        throw CFLib.getDefaultExceptionFactory().newUnsupportedClassException(getClass(), "expandBody",
                "genContext.getGenDef()", genDef, "ICFBamBoolDefObj");
    }

    return (ret);
}

From source file:net.sourceforge.msscodefactory.cfbam.v2_7.CFBamMssCF.CFBamMssCFBindValueGenerateId.java

public String expandBody(MssCFGenContext genContext) {
    final String S_ProcName = "CFBamMssCFBindValueGenerateId.expandBody() ";

    if (genContext == null) {
        throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), "expandBody", 1,
                "genContext");
    }// w  w  w  . jav a2 s.co m

    ICFLibAnyObj genDef = genContext.getGenDef();
    if (genDef == null) {
        throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), "expandBody", 1,
                "genContext.getGenDef()");
    }

    String ret;

    if (genDef instanceof ICFBamValueObj) {
        Boolean generateId = ((ICFBamValueObj) genDef).getOptionalGenerateId();
        if (generateId == null) {
            ret = null;
        } else if (generateId.booleanValue()) {
            ret = "yes";
        } else {
            ret = "no";
        }
    } else {
        throw CFLib.getDefaultExceptionFactory().newUnsupportedClassException(getClass(), "expandBody",
                "genContext.getGenDef()", genDef, "ICFBamValueObj");
    }

    return (ret);
}