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:fr.aliasource.webmail.server.proxy.client.http.folder.ListAvailableFolderMethod.java

public List<Folder> listAvailable() {
    Map<String, String> params = new HashMap<String, String>();
    params.put("token", token);

    Document doc = execute(params);
    List<Folder> ret = new LinkedList<Folder>();
    if (doc != null) {
        if (logger.isDebugEnabled()) {
            DOMUtils.logDom(doc);/*w w w .  j  a  v a  2  s  .co  m*/
        }
        String[][] values = DOMUtils.getAttributes(doc.getDocumentElement(), "folder",
                new String[] { "name", "displayName", "subscribed", "shared" });
        for (int i = 0; i < values.length; i++) {
            ret.add(new Folder(values[i][0], values[i][1], Boolean.valueOf(values[i][2]),
                    Boolean.valueOf(values[i][3])));
        }
    }
    return ret;
}

From source file:org.openfaces.component.chart.impl.generators.DynamicCategoryGenerator.java

public boolean generateCondition(CategoryDataset categoryDataset, int i, int i1) {
    return Boolean.valueOf(getValue(categoryDataset, i, i1));
}

From source file:basedefense.client.ClientProxy.java

/**
 * Executes a version check using GitHub's API.
 */// w  w  w .java 2  s . c  om
private void executeVersionCheck() {
    BaseDefenseModification.getInstance().getLogger().info("Version Check");
    long initializationTime = System.currentTimeMillis();

    if (!Boolean.valueOf(System.getProperty("basedefense.disableVersionCheck", "false"))) {
        this.latestVersion = (new ModificationVersionCheck()).check();
        this.latestVersion.ifPresent(v -> {
            if (v.equalsIgnoreCase(BaseDefenseModification.getInstance().getVersion()))
                return;

            BaseDefenseModification.getInstance().getLogger().warn("+--------------------------------+");
            BaseDefenseModification.getInstance().getLogger().warn("+          Base Defense          +");
            BaseDefenseModification.getInstance().getLogger().warn("+          is outdated!          +");
            BaseDefenseModification.getInstance().getLogger().warn("+--------------------------------+");
            BaseDefenseModification.getInstance().getLogger().warn("+  The support for this version  +");
            BaseDefenseModification.getInstance().getLogger().warn("+  has been discontinued.        +");
            BaseDefenseModification.getInstance().getLogger().warn("+  Please update to a newer      +");
            BaseDefenseModification.getInstance().getLogger().warn("+  release!                      +");
            BaseDefenseModification.getInstance().getLogger().warn("+--------------------------------+");
            BaseDefenseModification.getInstance().getLogger().warn("+  Installed: "
                    + StringUtils.rightPad(BaseDefenseModification.getInstance().getVersion(), 17) + "  +");
            BaseDefenseModification.getInstance().getLogger()
                    .warn("+  Latest:    " + StringUtils.rightPad(v, 17) + "  +");
            BaseDefenseModification.getInstance().getLogger().warn("+--------------------------------+");
        });
    } else {
        this.latestVersion = Optional.empty();

        BaseDefenseModification.getInstance().getLogger().warn("+---------------------------------+");
        BaseDefenseModification.getInstance().getLogger().warn("+          VERSION CHECK          +");
        BaseDefenseModification.getInstance().getLogger().warn("+             DISABLED            +");
        BaseDefenseModification.getInstance().getLogger().warn("+---------------------------------+");
        BaseDefenseModification.getInstance().getLogger().warn("+  Installed: "
                + StringUtils.rightPad(BaseDefenseModification.getInstance().getVersion(), 18) + "  +");
        BaseDefenseModification.getInstance().getLogger().warn("+---------------------------------+");
    }

    BaseDefenseModification.getInstance().getLogger()
            .info("Version Check ended (took " + (System.currentTimeMillis() - initializationTime) + " ms)");
}

From source file:com.wickettasks.business.entities.user.repository.TestUserRepository.java

@Test
public void testSaveUser() {
    User user = new User();
    user.setEmail("test@email");
    user.setPassword("password");
    this.userRepository.save(user);
    assertEquals(Boolean.TRUE, Boolean.valueOf(user.getId() != null));
}

From source file:com.jaspersoft.jasperserver.api.engine.jasperreports.util.AwsPropertyChanger.java

@Override
public void setProperty(String key, String val) {
    assert (key.startsWith(PROPERTY_PREFIX));
    log.debug("setting AWS property: " + key + " - " + val);

    if (AwsProperties.DB_SECURITY_GROUP_CHANGES_ENABLED.equals(key)) {
        awsProperties.setSecurityGroupChangesEnabled(Boolean.valueOf(val));
    } else if (AwsProperties.DB_SECURITY_GROUP_NAME.equals(key)) {
        awsProperties.setSecurityGroupName(val);
    } else if (AwsProperties.DB_SECURITY_GROUP_DESCRIPTION.equals(key)) {
        awsProperties.setSecurityGroupDescription(val);
    } else if (AwsProperties.DB_SECURITY_GROUP_INGRESS_PUBLIC_IP.equals(key)) {
        awsProperties.setSecurityGroupIngressPublicIp(val);
    } else if (AwsProperties.DB_SECURITY_GROUP_CHANGES_SUPPRESS_EC2_CREDENTIALS_WARNINGS.equals(key)) {
        awsProperties.setSuppressEc2CredentialsWarnings(Boolean.valueOf(val));
    } else {/*from  w w  w.j  a v  a 2s  .c o m*/
        throw new RuntimeException("Unknown AWS config property: " + key);
    }
}

From source file:org.sakuli.loader.BeanLoader.java

public static Region loadRegion(String resumeOnException) {
    logger.debug("Get an new Region object over BeanFactory.");
    return new Region(Boolean.valueOf(resumeOnException));
}

From source file:org.openfaces.component.chart.impl.generators.DynamicXYGenerator.java

public boolean generateCondition(XYDataset xyDataset, int i, int i1) {
    return Boolean.valueOf(getValue(xyDataset, i, i1));
}

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

protected ModelAndView handleContext(String contextName, Context context, HttpServletRequest request,
        HttpServletResponse response) throws Exception {
    if (!request.getContextPath().equals(contextName) && context != null) {
        try {//ww w.ja  v  a2 s .co  m
            if (context.getAvailable()) {
                logger.info(request.getRemoteAddr() + " requested STOP of " + contextName);
                getContainerWrapper().getTomcatContainer().stop(contextName);
            } else {
                logger.info(request.getRemoteAddr() + " requested START of " + contextName);
                getContainerWrapper().getTomcatContainer().start(contextName);
            }
        } 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:org.shareok.data.redis.RedisConfigImpl.java

@Override
public boolean getRegistrationConfig() {
    String allowRegistration;// www  . jav  a2s .c o  m
    try {
        BoundHashOperations<String, String, String> configOps = redisTemplate
                .boundHashOps(RedisUtil.getConfigQueryKey());
        if (configOps.hasKey("registrationConfig")) {
            allowRegistration = (String) configOps.get("registrationConfig");
        } else {
            allowRegistration = "false";
            configOps.put("registrationConfig", "false");
        }
        return Boolean.valueOf(allowRegistration);
    } catch (Exception ex) {
        logger.error("Cannot get allow registration info ", ex);
        return false;
    }
}

From source file:com.baasbox.BBConfiguration.java

public static Boolean getWrapResponse() {
    return Boolean.valueOf(configuration.getString(WRAP_RESPONSE));
}