Example usage for java.lang Boolean valueOf

List of usage examples for java.lang Boolean valueOf

Introduction

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

Prototype

public static Boolean valueOf(String s) 

Source Link

Document

Returns a Boolean with a value represented by the specified string.

Usage

From source file:de.hybris.platform.cronjob.jalo.PLA_12481_Test.java

@Before
public void prepareComposite() {
    final CompositeJobModel job = modelService.create(CompositeJobModel.class);
    job.setCode("CompJob");
    compCronJob = createCompositeCronJob(job, "CompCJ");

    legacyMode = StringUtils.isEmpty(Config.getParameter("relation.handle.legacy")) ? null
            : Boolean.valueOf(Config.getParameter("relation.handle.legacy"));
    Config.setParameter("relation.handle.legacy", Boolean.FALSE.toString());
}

From source file:dpfmanager.shell.core.DPFManagerProperties.java

public static boolean getFeedback() {
    String strVal = getPropertiesValue("feedback", "0");
    return Boolean.valueOf(strVal);
}

From source file:org.nabucco.alfresco.enhScriptEnv.common.webscripts.RemoteJavascriptDebuggerPost.java

/**
 *
 * {@inheritDoc}//w  w  w  .ja  v a  2s. c  om
 */
@Override
protected Map<String, Object> executeImpl(final WebScriptRequest req, final Status status) {
    final String visibleStr = req.getParameter("visible");
    final boolean visible = Boolean.parseBoolean(visibleStr);

    if (visible) {
        this.debugger.activate();
    } else {
        this.debugger.shutdown();
    }

    final Map<String, Object> model = new HashMap<String, Object>(7, 1.0f);
    model.put("visible", Boolean.valueOf(this.debugger.isActive()));
    return model;
}

From source file:com.enonic.cms.business.MockSitePropertiesService.java

public Boolean getPropertyAsBoolean(String key, SiteKey siteKey) {
    String svalue = getProperty(key, siteKey);

    return svalue == null ? Boolean.FALSE : Boolean.valueOf(svalue);
}

From source file:com.googlecode.psiprobe.controllers.datasources.ListAllJdbcResourcesController.java

protected ModelAndView handleRequestInternal(HttpServletRequest request,
        HttpServletResponse httpServletResponse) throws Exception {
    boolean supportsGlobal = getContainerWrapper().getResourceResolver().supportsGlobalResources();
    boolean supportsPrivate = getContainerWrapper().getResourceResolver().supportsPrivateResources();
    boolean supportsDSLookup = getContainerWrapper().getResourceResolver().supportsDataSourceLookup();
    List privateResources = getContainerWrapper().getPrivateDataSources();
    List globalResources = getContainerWrapper().getGlobalDataSources();
    return new ModelAndView(getViewName()).addObject("supportsGlobal", Boolean.valueOf(supportsGlobal))
            .addObject("supportsPrivate", Boolean.valueOf(supportsPrivate))
            .addObject("supportsDSLookup", Boolean.valueOf(supportsDSLookup))
            .addObject("privateResources", privateResources).addObject("globalResources", globalResources);
}

From source file:de.tudarmstadt.lt.nlkg.EvaluatePreds.java

static void evaluate(String file) throws IllegalArgumentException, FileNotFoundException {
    DT dt = new DT() {
        {//from ww w  .  ja  v  a  2s  . co m
            _mysql_dbname = "nlkg_1";
        }
    };
    LineIterator iter = new LineIterator(new FileReader(file));
    iter.nextLine(); // skip first line
    int lineno = 1;
    double tp = 0d, tn = 0d, fp = 0d, fn = 0d;
    while (iter.hasNext() && (lineno < 100 || true)) {
        lineno++;
        String line = iter.nextLine();
        if (line.trim().isEmpty())
            continue;

        String[] splits = line.split("\t");
        String x = splits[0].trim();
        String y = splits[1].trim();
        String pred_l = splits[2].trim();
        String pred_r = splits[3].trim();
        boolean entailing_trueclass = Boolean.valueOf(splits[4].trim());

        _X.add(x);
        _Y.add(y);
        _PRED_L.add(pred_l);
        _PRED_R.add(pred_r);
        _ENTAILING.add(entailing_trueclass);

        boolean entailing_predicted = predictEntailing(dt, pred_l, pred_r);
        if (lineno % 100 == 0)
            Evaluate.log_progress();

        if (entailing_predicted && entailing_trueclass) {
            Evaluate.log_true(String.format("%d %-10s %-30s %-30s %b %n", lineno, "tp", pred_l, pred_r,
                    entailing_trueclass));
            tp++;
        }
        if (!entailing_predicted && !entailing_trueclass) {
            Evaluate.log_true(String.format("%d %-10s %-30s %-30s %b %n", lineno, "tn", pred_l, pred_r,
                    entailing_trueclass));
            tn++;
        }
        if (entailing_predicted && !entailing_trueclass) {
            Evaluate.log_false(String.format("%d %-10s %-30s %-30s %b %n", lineno, "fp", pred_l, pred_r,
                    entailing_trueclass));
            fp++;
        }
        if (!entailing_predicted && entailing_trueclass) {
            Evaluate.log_false(String.format("%d %-10s %-30s %-30s %b %n", lineno, "fn", pred_l, pred_r,
                    entailing_trueclass));
            fn++;
        }

    }

    System.out.format("tp: %d; fp: %d; fn: %d; tn: %d; %n", (int) tp, (int) fp, (int) fn, (int) tn);
    System.out.println("Precision = " + (tp / (tp + fp)));
    System.out.println("Recall    = " + (tp / (tp + fn)));
    System.out.println("F1        = " + ((2 * tp) / ((2 * tp) + fn + fp)));

    dt.disconnect();

}

From source file:com.googlecode.psiprobe.controllers.apps.AjaxReloadContextController.java

protected ModelAndView handleContext(String contextName, Context context, HttpServletRequest request,
        HttpServletResponse response) throws Exception {
    if (!request.getContextPath().equals(contextName) && context != null) {
        try {//  w  w  w .ja  v  a  2s  . c  om
            logger.info(request.getRemoteAddr() + " requested RELOAD of " + contextName);
            context.reload();
        } catch (Throwable e) {
            logger.error(e);
            //
            // make sure we always re-throw ThreadDeath
            //
            if (e instanceof ThreadDeath) {
                throw (ThreadDeath) e;
            }
        }
    }
    return new ModelAndView(getViewName(), "available", Boolean
            .valueOf(context != null && getContainerWrapper().getTomcatContainer().getAvailable(context)));
}

From source file:com.ankang.report.filet.iml.AttributeConverFileter.java

@Override
public ReportResponse invoke(Invoker invoker, HttpServletRequest request, Invocation invocation)
        throws Exception {

    ReportResponse response = invoker.invoke(request, invocation);

    Object IS_DEFINED_RESPONSE = ReportConfig.getValue(ReportConfigItem.IS_DEFINED_RESPONSE.getConfigName());
    if (null != IS_DEFINED_RESPONSE && Boolean.valueOf(IS_DEFINED_RESPONSE.toString())) {

        Object object;/*w  w w  .j  ava2  s.  c om*/

        String code = null == (object = ReportConfig.getValue(ReportConfigItem.RESPONSE_CODE.getConfigName()))
                ? ""
                : object.toString();
        String message = null == (object = ReportConfig
                .getValue(ReportConfigItem.RESPONSE_MESSAGE.getConfigName())) ? "" : object.toString();
        String result = null == (object = ReportConfig
                .getValue(ReportConfigItem.RESPONSE_RESULT.getConfigName())) ? "" : object.toString();
        if (null != response.getResponse()) {
            Field[] fields = response.getResponse().getClass().getDeclaredFields();
            for (Field field : fields) {
                field.setAccessible(true);
                object = field.get(response.getResponse());
                if (null != object) {
                    if (StringUtils.isNotEmpty(code) && code.equals(field.getName())) {
                        response.setCode(Integer.valueOf(object.toString()));
                        continue;
                    }
                    if (StringUtils.isNotEmpty(message) && message.equals(field.getName())) {
                        response.setMessage(field.get(response.getResponse()).toString());
                        continue;
                    }
                    if (StringUtils.isNotEmpty(result) && result.equals(field.getName())) {
                        response.setResponse(field.get(response.getResponse()));
                        continue;
                    }
                }
            }
        }
    }
    return response;
}

From source file:eu.optimis.tf.sp.service.SPDeployment.java

public SPDeployment() {
    production = Boolean.valueOf(PropertiesUtils.getProperty("TRUST", "production"));
}

From source file:com.googlecode.psiprobe.controllers.wrapper.StopJvmController.java

protected ModelAndView handleRequestInternal(HttpServletRequest request, HttpServletResponse response)
        throws Exception {
    boolean done = false;
    try {/*ww w. ja va  2  s . c om*/
        Class.forName("org.tanukisoftware.wrapper.WrapperManager");
        logger.info("JVM is STOPPED by " + request.getRemoteAddr());
        WrapperManager.stop(stopExitCode);
        done = true;
    } catch (ClassNotFoundException e) {
        logger.info("WrapperManager not found. Do you have wrapper.jar in the classpath?");
    }
    return new ModelAndView(getViewName(), "done", Boolean.valueOf(done));
}