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:com.googlecode.jtiger.modules.ecside.core.bean.RowDefaults.java

static Boolean isSelectlightRow(TableModel model, Boolean selectlightRow) {
    if (selectlightRow == null) {
        return Boolean.valueOf(model.getPreferences().getPreference(PreferencesConstants.ROW_SELECTLIGHT_ROW));
    }/*from www  . j a  v  a2  s . co m*/

    return selectlightRow;
}

From source file:com.netflix.genie.web.controllers.IntegrationTestActiveProfilesResolver.java

/**
 * {@inheritDoc}/*from   www  .ja v  a 2s  .c om*/
 */
@Override
public String[] resolve(final Class<?> testClass) {
    final boolean isCI = Boolean.valueOf(System.getProperty("CI", "false"));
    final boolean isTravis = Boolean.valueOf(System.getProperty("TRAVIS", "false"));

    final String[] activeProfiles;
    if (isCI || isTravis) {
        activeProfiles = new String[] { "ci" };
    } else {
        activeProfiles = new String[] { "integration" };
    }

    return activeProfiles;
}

From source file:com.sixt.service.framework.FeatureFlags.java

public static boolean shouldDisableRpcInstanceRetry(ServiceProperties serviceProps) {
    String value = serviceProps.getProperty(DISABLE_RPC_INSTANCE_RETRY);
    if (StringUtils.isNotEmpty(value) && Boolean.valueOf(value)) {
        return true;
    } else {//w  w w .  j  a  va 2 s.com
        return false;
    }
}

From source file:gobblin.runtime.EmailNotificationJobListener.java

@Override
public void onJobCompletion(JobState jobState) {
    boolean alertEmailEnabled = Boolean
            .valueOf(jobState.getProp(ConfigurationKeys.ALERT_EMAIL_ENABLED_KEY, Boolean.toString(false)));
    boolean notificationEmailEnabled = Boolean.valueOf(
            jobState.getProp(ConfigurationKeys.NOTIFICATION_EMAIL_ENABLED_KEY, Boolean.toString(false)));

    // Send out alert email if the maximum number of consecutive failures is reached
    if (jobState.getState() == JobState.RunningState.FAILED) {
        int failures = jobState.getPropAsInt(ConfigurationKeys.JOB_FAILURES_KEY, 0);
        int maxFailures = jobState.getPropAsInt(ConfigurationKeys.JOB_MAX_FAILURES_KEY,
                ConfigurationKeys.DEFAULT_JOB_MAX_FAILURES);
        if (alertEmailEnabled && failures >= maxFailures) {
            try {
                EmailUtils.sendJobFailureAlertEmail(jobState.getJobName(), jobState.toString(), failures,
                        jobState);//  w  w  w .jav  a  2  s.  com
            } catch (EmailException ee) {
                LOGGER.error("Failed to send job failure alert email for job " + jobState.getJobId(), ee);
            }
            return;
        }
    }

    if (notificationEmailEnabled) {
        try {
            EmailUtils.sendJobCompletionEmail(jobState.getJobId(), jobState.toString(),
                    jobState.getState().toString(), jobState);
        } catch (EmailException ee) {
            LOGGER.error("Failed to send job completion notification email for job " + jobState.getJobId(), ee);
        }
    }
}

From source file:com.htmlhifive.tools.jslint.engine.option.xml.JaxbUtil.java

/**
 * JsCheckOptionsxml????.//from w ww.j a v  a 2  s. co m
 * 
 * 
 * @param checkOptions .
 * @param output .
 */
public static void saveJsCheckOption(JsCheckOption checkOptions, IFile output) {
    try {
        Marshaller marshall = jc.createMarshaller();
        marshall.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.valueOf(true));
        StringWriter writer = new StringWriter();
        marshall.marshal(checkOptions, writer);
        if (output.exists()) {
            output.setContents(IOUtils.toInputStream(writer.toString(), "UTF-8"), IResource.FORCE, null);
        } else {
            output.create(IOUtils.toInputStream(writer.toString(), "UTF-8"), true, null);
        }
        output.refreshLocal(IResource.DEPTH_ONE, null);
    } catch (JAXBException e) {
        logger.put(Messages.EM0006, e, output.getName());
    } catch (CoreException e) {
        logger.put(Messages.EM0100, e);
    } catch (IOException e) {
        logger.put(Messages.EM0006, e, output.getName());
    }
}

From source file:org.leandreck.endpoints.processor.model.VariableAnnotations.java

public static boolean isOptional(final AnnotationMirror annotationMirror) {
    final boolean relevantAnnotation = Arrays.stream(VariableAnnotations.values())
            .map(it -> annotationMirror.getAnnotationType().toString().startsWith(it.annotation))
            .reduce((a, b) -> a || b).orElse(false);

    final boolean optional;
    if (relevantAnnotation) {
        final String required = annotationMirror.getElementValues().entrySet().stream()
                .filter(e -> e.getKey().toString().equals("required()")).map(e -> e.getValue().toString())
                .findFirst().orElse("true");
        optional = !Boolean.valueOf(required);
    } else {//w  w w  .j a  va2s.c  o  m
        optional = false;
    }

    return optional;
}

From source file:org.intalio.tempo.portlet.TasksAction.java

@Override
public ModelAndView execute() {
    if (Boolean.valueOf(_request.getParameter("update"))) {
        return new ModelAndView(Constants.TASKS_UPDATE_VIEW, createModel());
    } else {//w  w w . j  a v a 2s. co  m
        return new ModelAndView(Constants.TASKS_VIEW, createModel());
    }
}

From source file:com.cnd.greencube.web.base.template.method.CurrencyMethod.java

@SuppressWarnings("rawtypes")
public Object exec(List arguments) throws TemplateModelException {
    if (arguments != null && !arguments.isEmpty() && arguments.get(0) != null
            && StringUtils.isNotEmpty(arguments.get(0).toString())) {
        boolean showSign = false;
        boolean showUnit = false;
        if (arguments.size() == 2) {
            if (arguments.get(1) != null) {
                showSign = Boolean.valueOf(arguments.get(1).toString());
            }/*from w w w. j av  a2  s.c  o  m*/
        } else if (arguments.size() > 2) {
            if (arguments.get(1) != null) {
                showSign = Boolean.valueOf(arguments.get(1).toString());
            }
            if (arguments.get(2) != null) {
                showUnit = Boolean.valueOf(arguments.get(2).toString());
            }
        }

        BigDecimal amount = new BigDecimal(arguments.get(0).toString());
        String price = CurrencyUtils.setScale(amount).toString();
        if (showSign) {
            price = "" + price;
        }
        if (showUnit) {
            price += "";
        }
        return new SimpleScalar(price);
    }
    return null;
}

From source file:com.janrain.backplane.server.config.Backplane1Config.java

/**
* @return the debugMode// w  w w . j a v  a  2 s.c o m
*/
public static boolean isDebugMode() {
    return Boolean.valueOf(cachedGet(BpServerConfig.Field.DEBUG_MODE));
}

From source file:com.glaf.core.config.CustomProperties.java

public static boolean getBoolean(String key) {
    if (hasObject(key)) {
        String value = properties.getProperty(key);
        return Boolean.valueOf(value).booleanValue();
    }/* w w  w.  j a  va  2 s.c o m*/
    return false;
}