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:com.aurel.track.prop.LoginBL.java

private static List getModuleDescriptors(TPersonBean personBean) {
    // modules/*from ww w . j av  a  2  s.c  o m*/
    List modules = PluginManager.getInstance().getModuleDescriptors();

    // exclude wikimodule if there is no license
    Map<String, Boolean> licensedFearturesMap = personBean.getLicensedFeaturesMap();
    String licenseWiki = "wiki";
    Boolean haveWikiLicense = licensedFearturesMap.get(licenseWiki);
    String licenseAlm = "alm";
    Boolean haveAlmLicense = licensedFearturesMap.get(licenseAlm);
    if (haveAlmLicense != null && haveAlmLicense.booleanValue()) {
        // if a user have alm license then the wiki shouuld be enabled aso
        haveWikiLicense = true;
    }
    if (haveWikiLicense == null || haveWikiLicense.booleanValue() == false) {
        // no license for wiki, remove license module
        if (modules != null && !modules.isEmpty()) {
            ModuleDescriptor moduleDescriptor;
            for (int i = 0; i < modules.size(); i++) {
                moduleDescriptor = (ModuleDescriptor) modules.get(i);
                if (moduleDescriptor.getId().equals(ModuleDescriptor.WIKI_MODULE)) {
                    modules.remove(i);
                    break;
                }
            }
        }
    }
    return modules;
}

From source file:com.glaf.activiti.delegate.Automatic.java

public void execute(ActivityExecution activityContext) throws Exception {
    if (conditionExpression != null) {
        Object value = conditionExpression.getValue(activityContext);
        if (value != null) {
            logger.debug("condition:" + value);
            if (value instanceof Boolean) {
                Boolean b = (Boolean) value;
                if (b.booleanValue()) {
                    PvmTransition defaultOutgoingTransition = activityContext.getActivity()
                            .getOutgoingTransitions().get(0);
                    activityContext.take(defaultOutgoingTransition);
                }/*from  w ww .  jav  a 2s. c om*/
            }
        }
    }
}

From source file:com.glaf.activiti.tasklistener.CancelLoopTaskListener.java

public void notify(DelegateTask delegateTask) {
    logger.debug("----------------------------------------------------");
    logger.debug("------------------CancelLoopTaskListener------------");
    logger.debug("----------------------------------------------------");
    if (conditionExpression != null) {
        Object value = conditionExpression.getValue(delegateTask);
        if (value != null) {
            logger.debug("condition:" + value);
            if (value instanceof Boolean) {
                Boolean b = (Boolean) value;
                if (b.booleanValue()) {
                    if (delegateTask.getVariable(Constants.NUMBER_OF_COMPLETED_INSTANCES) != null) {
                        int nrOfCompletedInstances = (Integer) delegateTask
                                .getVariable(Constants.NUMBER_OF_COMPLETED_INSTANCES);
                        delegateTask.setVariable(Constants.NUMBER_OF_COMPLETED_INSTANCES,
                                nrOfCompletedInstances + 10000);
                    }//from w w w.jav  a 2  s . com
                }
            }
        }
    }
}

From source file:com.glaf.activiti.tasklistener.CancelTaskMultiInstanceListener.java

@Override
public void notify(DelegateTask delegateTask) {
    logger.debug("----------------------------------------------------");
    logger.debug("---------------CancelTaskMultiInstanceListener------");
    logger.debug("----------------------------------------------------");
    if (conditionExpression != null) {
        Object value = conditionExpression.getValue(delegateTask);
        if (value != null) {
            logger.debug("condition:" + value);
            if (value instanceof Boolean) {
                Boolean b = (Boolean) value;
                if (b.booleanValue()) {
                    if (delegateTask.getVariable(Constants.NUMBER_OF_COMPLETED_INSTANCES) != null) {
                        int nrOfCompletedInstances = (Integer) delegateTask
                                .getVariable(Constants.NUMBER_OF_COMPLETED_INSTANCES);
                        delegateTask.setVariable(Constants.NUMBER_OF_COMPLETED_INSTANCES,
                                nrOfCompletedInstances + 10000);
                    }/*from ww  w  .  ja  v  a 2 s  .  com*/
                }
            }
        }
    }
}

From source file:org.openspaces.focalserver.FocalServer.java

public void postRegister(Boolean success) {
    if (success.booleanValue()) {
        listenForRegistration();
    }
}

From source file:com.jythonui.server.security.resolver.SecurityResolver.java

@Override
public boolean isAuthorized(Subject currentUser, String permission) {
    Object o = evaluate(currentUser, permission);
    if (!(o instanceof Boolean)) {
        severe(gMess.getMess(IErrorCode.ERRORCODE10, ILogMess.JEXLERRORNOTBOOLEAN, permission));
        return false;
    }/*  w ww.  j ava  2s .co m*/
    Boolean b = (Boolean) o;
    return b.booleanValue();
}

From source file:net.lightbody.bmp.proxy.jetty.jetty.servlet.jmx.ServletHandlerMBean.java

public void postRegister(Boolean ok) {
    super.postRegister(ok);
    if (ok.booleanValue())
        getSessionManager();//from   w w  w. j  a v a2s.c om
}

From source file:gov.nih.nci.cabig.caaers.service.migrator.EvaluateAndInitiateReportConverter.java

private boolean isTrue(Boolean bool) {
    if (bool != null) {
        return bool.booleanValue();
    }/*from  w ww  . j a v  a 2s  .co  m*/
    return false;
}

From source file:com.aurel.track.prop.LoginBL.java

/**
 * This method controls entire login procedure.
 *
 * @param isInTestMode//from   ww  w.j a  v a 2 s . co m
 * @param isMobileApplication
 * @param username
 * @param usingContainerBasedAuthentication
 * @param password
 * @param forwardUrl
 * @param springAuthenticated
 * @param mobileApplicationVersionNo
 * @param locale
 * @return
 */
public static String restLogin(String username, String password, Locale locale) {
    Map envResult = null;
    ArrayList<LabelValueBean> errors = new ArrayList<LabelValueBean>();

    TPersonBean user = userIdentifiedByToken(username, password);
    if (user == null) {
        HttpServletRequest request = ServletActionContext.getRequest();

        if (locale == null) {
            locale = Locale.getDefault();
            LOGGER.debug("Requested locale is null. Using default:" + locale.getDisplayName());
        } else {
            LOGGER.debug("Requested locale " + locale.getDisplayName());
        }

        envResult = LoginBL.setEnvironment(username, password, null, request,
                ActionContext.getContext().getSession(), false, false, false);

        user = (TPersonBean) envResult.get("user");

        String tokenPasswd = DigestUtils.md5Hex(Long.toString(new Date().getTime())).substring(0, 7);

        if (user != null) {
            user.setTokenPasswd(tokenPasswd);
        }

        Integer mappingEnum = (Integer) envResult.get("mappingEnum");

        errors = (ArrayList<LabelValueBean>) envResult.get("errors");
    }

    Boolean ready = (Boolean) ServletActionContext.getServletContext().getAttribute(ApplicationStarter.READY);
    if (ready == null || ready.booleanValue() == false) {
        errors.add(new LabelValueBean("notReady", "Server not ready"));
    }
    StringBuilder sb = new StringBuilder("{");
    if (user == null || (errors != null && errors.size() > 0)) {
        JSONUtility.appendBooleanValue(sb, JSONUtility.JSON_FIELDS.SUCCESS, false);
        sb.append(DATABRACE);
        JSONUtility.appendLabelValueBeanList(sb, "errors", errors);
    } else {
        user.setTokenExpDate(new Date(new Date().getTime() + 120 * 60 * 1000));
        DAOFactory.getFactory().getPersonDAO().save(user);

        JSONUtility.appendBooleanValue(sb, JSONUtility.JSON_FIELDS.SUCCESS, true);
        sb.append(DATABRACE);
        JSONUtility.appendStringValue(sb, "token", user.getTokenPasswd());
    }
    sb.append("}}");

    return writeJSONResponse(sb); // The redirect is done by the client
    // JavaScript
}

From source file:org.infinitest.eclipse.prefs.PreferenceChangeHandler.java

private void updateAutoTest(Boolean continuouslyTest) {
    if (continuouslyTest.booleanValue()) {
        controller.enable();
    } else {
        controller.disable();
    }
}