Example usage for org.apache.commons.lang3 BooleanUtils toBoolean

List of usage examples for org.apache.commons.lang3 BooleanUtils toBoolean

Introduction

In this page you can find the example usage for org.apache.commons.lang3 BooleanUtils toBoolean.

Prototype

public static boolean toBoolean(final String str) 

Source Link

Document

Converts a String to a boolean (optimised for performance).

'true' , 'on' , 'y' , 't' or 'yes' (case insensitive) will return true .

Usage

From source file:net.sf.gazpachoquest.dto.answers.BooleanAnswer.java

public static BooleanAnswer valueOf(String option, Boolean value) {
    return new BooleanAnswer(option, BooleanUtils.toBoolean(value));
}

From source file:de.pixida.logtest.engine.conditions.AlwaysTriggeringCondition.java

@Override
public void init(final IEdgeDefinition edgeDefinition, final IParameters parameters,
        final ScriptEngine scriptingEngine) {
    this.setIsActive(BooleanUtils.toBoolean(edgeDefinition.getTriggerAlways()));
}

From source file:com.tugo.dt.ApplicationTest.java

@Test
public void test1() throws IOException {
    boolean b = BooleanUtils.toBoolean("true");
    System.out.println(b);/*from   w  w w  . j  av a 2 s. co m*/

    b = BooleanUtils.toBoolean("false");
    System.out.println(b);

    b = BooleanUtils.toBoolean("true1");
    System.out.println(b);

    b = BooleanUtils.toBoolean((String) null);
    System.out.println(b);

    String[] arr = StringUtils.split("[tushar,gosavi]", ",");
    for (String a : arr) {
        System.out.println(a);
    }
}

From source file:com.autonomy.nonaci.indexing.impl.DreCreateDBaseCommand.java

public boolean isInternal() {
    return BooleanUtils.toBoolean(get(PARAM_INTERNAL));
}

From source file:com.autonomy.nonaci.indexing.impl.DreReplaceCommand.java

public boolean isInsertValue() {
    return BooleanUtils.toBoolean(get(PARAM_INSERT_VALUE));
}

From source file:com.tacitknowledge.flip.aspectj.converters.BooleanConverter.java

/** {@inheritDoc } */
public Object convert(String expression, Class outputClass) {
    return BooleanUtils.toBoolean(expression);
}

From source file:gov.nih.nci.caintegrator.web.action.LoginAction.java

/**
 * Opens login screen./*from  w ww . ja va2 s . c  om*/
 * @return - login.
 */
public String openLogin() {
    String ssoEnabled = servletContext.getInitParameter("ssoEnabled");
    String currentUser = SecurityHelper.getCurrentUsername();
    if (BooleanUtils.toBoolean(ssoEnabled) && SessionHelper.getInstance().isStudyManager()) {
        getDataRefreshRunner().setUser(currentUser);
        getDataRefreshRunner().startTask();
    }
    return LOGIN;
}

From source file:com.autonomy.nonaci.indexing.impl.AbstractExportCommand.java

public boolean isCompress() {
    return BooleanUtils.toBoolean(get(PARAM_COMPRESS));
}

From source file:com.cognifide.aet.job.common.comparators.accessibility.report.AccessibilityReportConfiguration.java

public AccessibilityReportConfiguration(Map<String, String> params) {
    if (params.containsKey(PARAM_SHOW_EXCLUDED)) {
        showExcluded = BooleanUtils.toBoolean(params.get(PARAM_SHOW_EXCLUDED));
    }//from  w  w w .ja  v  a2  s . co  m

    if (params.containsKey(PARAM_IGNORE_NOTICE)) {
        ignoreNotice = BooleanUtils.toBoolean(params.get(PARAM_IGNORE_NOTICE));
    }

    String reportLevelString = StringUtils.defaultString(params.get(PARAM_REPORT_LEVEL), DEFAULT_REPORT_LEVEL);
    if (!ignoreNotice) {
        reportLevelString = IssueType.NOTICE.toString();
    }

    IssueType reportLevel;
    reportLevel = IssueType.valueOf(reportLevelString.toUpperCase());

    showNotice = IssueType.NOTICE.compareTo(reportLevel) <= 0;
    showWarning = IssueType.WARN.compareTo(reportLevel) <= 0;
}

From source file:com.autonomy.nonaci.indexing.impl.DreCreateDBaseCommand.java

public boolean isReadOnly() {
    return BooleanUtils.toBoolean(get(PARAM_READ_ONLY));
}