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:jp.co.opentone.bsol.linkbinder.view.ErrorPage.java

/**
 * ?????true./*w w w.  ja v a 2 s  .c  om*/
 * @return ???true
 */
public boolean isShowCloseLink() {
    try {
        Boolean flg = new Flash().getValue(KEY_SHOW_CLOSE_LINK);
        return (flg != null && flg.booleanValue());
    } catch (Exception e) {
        LOG.error(e.getMessage(), e);
        return false;
    }
}

From source file:com.kulik.android.jaxb.library.composer.providers.jsonProvider.JSONObjectProvider.java

@Override
public void putAttributeBoolean(String annotationName, Boolean value) {
    try {/*www . j  a va  2 s.  co m*/
        mJSONObject.put(annotationName, value.booleanValue());
    } catch (JSONException e) {
        Log.e(TAG, e.toString());
    }
}

From source file:com.lurencun.cfuture09.androidkit.http.async.RetryHandler.java

@Override
public boolean retryRequest(IOException exception, int executionCount, HttpContext context) {
    // ??/* www  . j  av  a  2s  .com*/
    boolean retry = true;

    // ?
    Boolean b = (Boolean) context.getAttribute(ExecutionContext.HTTP_REQ_SENT);
    boolean sent = (b != null && b.booleanValue());

    if (executionCount > maxRetries) {
        // ????
        retry = false;
    } else if (isInList(exceptionBlacklist, exception)) {
        // ??????
        retry = false;
    } else if (isInList(exceptionWhitelist, exception)) {
        // ????
        retry = true;
    } else if (!sent) {
        // ?????
        retry = true;
    }

    if (retry) {
        // resend all idempotent requests
        HttpUriRequest currentReq = (HttpUriRequest) context.getAttribute(ExecutionContext.HTTP_REQUEST);
        String requestType = currentReq.getMethod();
        retry = !requestType.equals("POST");
    }

    if (retry) {
        SystemClock.sleep(RETRY_SLEEP_TIME_MILLIS);
    } else {
        exception.printStackTrace();
        log.w(exception);
    }
    return retry;
}

From source file:be.fedict.eid.idp.protocol.ws_federation.sts.WSSecuritySoapHandler.java

@Override
public boolean handleMessage(SOAPMessageContext context) {
    Boolean outboundProperty = (Boolean) context.get(MessageContext.MESSAGE_OUTBOUND_PROPERTY);
    if (true == outboundProperty.booleanValue()) {
        try {//from  w ww .j  a  va2 s.c  o m
            handleOutboundMessage(context);
        } catch (Exception e) {
            throw new ProtocolException(e);
        }
    } else {
        try {
            handleInboundMessage(context);
        } catch (Exception e) {
            throw new ProtocolException(e);
        }
    }
    return true;
}

From source file:org.esigate.http.OutgoingRequestContext.java

public boolean isProxy() {
    Boolean proxy = getAttribute(PROXY, Boolean.class);
    if (proxy == null) {
        return false;
    } else {//  w w  w  . j  a v  a 2 s.c  o  m
        return proxy.booleanValue();
    }
}

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

/**
 * Whether the value matches or not//from ww w .j ava 2  s .  c  om
 * @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;
    }
    Integer attributeValueInteger = null;
    Integer matcherValueInteger = null;
    try {
        attributeValueInteger = (Integer) attributeValue;
    } catch (Exception e) {
        LOGGER.warn("Converting the attribute value " + attributeValue + " of type "
                + attributeValue.getClass().getName() + " to Integer failed with " + e.getMessage());
        LOGGER.debug(ExceptionUtils.getStackTrace(e));
        return false;
    }
    try {
        matcherValueInteger = (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;
    }
    switch (relation) {
    case MatchRelations.EQUAL:
        return attributeValueInteger.intValue() == matcherValueInteger.intValue();
    case MatchRelations.NOT_EQUAL:
        return attributeValueInteger.intValue() != matcherValueInteger.intValue();
    case MatchRelations.GREATHER_THAN:
        return attributeValueInteger.intValue() > matcherValueInteger.intValue();
    case MatchRelations.GREATHER_THAN_EQUAL:
        return attributeValueInteger.intValue() >= matcherValueInteger.intValue();
    case MatchRelations.LESS_THAN:
        return attributeValueInteger.intValue() < matcherValueInteger.intValue();
    case MatchRelations.LESS_THAN_EQUAL:
        return attributeValueInteger.intValue() <= matcherValueInteger.intValue();
    default:
        return false;
    }
}

From source file:com.litesuits.http.impl.httpURLConnection.CustomHttpRequestRetryHandler.java

protected boolean handleAsIdempotent(final AbstractRequest request) {
    if (request == null) {
        return true;
    }// www . j a v a2  s.c om
    final HttpMethods method = request.getMethod();
    final Boolean b = this.idempotentMethods.get(method);
    return b != null && b.booleanValue();
}

From source file:jp.primecloud.auto.nifty.soap.security.SignatureHandler.java

/**
 * {@inheritDoc}//from w  ww. jav a 2  s. c  o  m
 */
@Override
public boolean handleMessage(SOAPMessageContext context) {
    Boolean outbound = (Boolean) context.get(MessageContext.MESSAGE_OUTBOUND_PROPERTY);
    if (outbound != null && outbound.booleanValue()) {
        try {
            Document document = context.getMessage().getSOAPPart();

            WSSecHeader header = new WSSecHeader();
            header.insertSecurityHeader(document);

            WSSecSignature signature = new WSSecSignature();
            signature.setKeyIdentifierType(WSConstants.BST_DIRECT_REFERENCE);
            signature.prepare(document, crypto, header);

            signature.appendBSTElementToHeader(header);
            signature.appendToHeader(header);
            signature.computeSignature();
        } catch (WSSecurityException e) {
            throw new RuntimeException(e);
        }
    }

    if (log.isDebugEnabled()) {
        try {
            String envelope = transform(context.getMessage().getSOAPPart());
            log.debug(envelope);
        } catch (TransformerException e) {
            log.warn(e.getMessage());
        }
    }

    return true;
}

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

/**
 * Whether the value matches or not//from ww w.j a va  2  s  .c  om
 * 
 * @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;
    }
    Double attributeValueDouble = null;
    Double matcherValueDouble = null;
    try {
        attributeValueDouble = (Double) attributeValue;
    } catch (Exception e) {
        LOGGER.error("Converting the attribute value " + attributeValue + " of type "
                + attributeValue.getClass().getName() + " to Double failed with " + e.getMessage());
        LOGGER.debug(ExceptionUtils.getStackTrace(e));
        return false;
    }
    try {
        matcherValueDouble = (Double) matchValue;
    } catch (Exception e) {
        LOGGER.warn("Converting the matcher value " + matchValue + " of type " + matchValue.getClass().getName()
                + " to Double failed with " + e.getMessage(), e);
        return false;
    }

    switch (relation) {
    case MatchRelations.EQUAL:
        return (Double.doubleToRawLongBits(attributeValueDouble.doubleValue())
                - Double.doubleToRawLongBits(matcherValueDouble.doubleValue()) == 0);
    case MatchRelations.NOT_EQUAL:
        return (Double.doubleToRawLongBits(attributeValueDouble.doubleValue())
                - Double.doubleToRawLongBits(matcherValueDouble.doubleValue()) != 0);
    case MatchRelations.GREATHER_THAN:
        return attributeValueDouble.doubleValue() > matcherValueDouble.doubleValue();
    case MatchRelations.GREATHER_THAN_EQUAL:
        return attributeValueDouble.doubleValue() >= matcherValueDouble.doubleValue();
    case MatchRelations.LESS_THAN:
        return attributeValueDouble.doubleValue() < matcherValueDouble.doubleValue();
    case MatchRelations.LESS_THAN_EQUAL:
        return attributeValueDouble.doubleValue() <= matcherValueDouble.doubleValue();
    default:
        return false;
    }
}

From source file:com.epam.cme.facades.converters.populator.SearchProductTelcoPopulator.java

@Override
public void populate(final SOURCE source, final TARGET target) {
    final ProductData telcoProduct = target;

    final String billingTimeAsString = this.getValue(source, "billingTime");
    final BillingTimeData billingTime = new BillingTimeData();
    billingTime.setName(billingTimeAsString);

    if (telcoProduct.getSubscriptionTerm() == null) {
        telcoProduct.setSubscriptionTerm(new SubscriptionTermData());
        telcoProduct.getSubscriptionTerm().setBillingPlan(new BillingPlanData());
    }/*from w  w  w  . j a va  2  s  . c om*/

    if (telcoProduct.getSubscriptionTerm().getBillingPlan() == null) {
        telcoProduct.getSubscriptionTerm().setBillingPlan(new BillingPlanData());
    }

    telcoProduct.getSubscriptionTerm().getBillingPlan().setBillingTime(billingTime);

    final Boolean soldIndividually = this.getValue(source, ProductModel.SOLDINDIVIDUALLY);
    telcoProduct.setSoldIndividually(soldIndividually == null ? true : soldIndividually.booleanValue());

    final String termOfServiceFrequencyAsString = this.getValue(source, "termLimit");
    final TermOfServiceFrequencyData termOfServiceFrequencyData = new TermOfServiceFrequencyData();
    termOfServiceFrequencyData.setName(termOfServiceFrequencyAsString);
    telcoProduct.getSubscriptionTerm().setTermOfServiceFrequency(termOfServiceFrequencyData);

    final Double lowestBundlePriceValue = this.getValue(source, "lowestBundlePriceValue");
    telcoProduct.setLowestBundlePrice(lowestBundlePriceValue == null ? null
            : getPriceDataFactory().create(PriceDataType.BUY,
                    BigDecimal.valueOf(lowestBundlePriceValue.doubleValue()),
                    getCommonI18NService().getCurrentCurrency().getIsocode()));
}