Example usage for java.lang Boolean FALSE

List of usage examples for java.lang Boolean FALSE

Introduction

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

Prototype

Boolean FALSE

To view the source code for java.lang Boolean FALSE.

Click Source Link

Document

The Boolean object corresponding to the primitive value false .

Usage

From source file:org.eclipse.hono.service.cache.SpringBasedExpiringValueCacheTest.java

/**
 * Verifies that the cache returns non-expired values.
 *//*ww w .  ja v  a 2 s .  c  o  m*/
@SuppressWarnings("unchecked")
@Test
public void testGetResponseFromCache() {

    // GIVEN a cache that contains a non-expired response
    final ExpiringValue<String> value = mock(ExpiringValue.class);
    when(value.isExpired()).thenReturn(Boolean.FALSE);
    when(value.getValue()).thenReturn("hello");
    when(springCache.get("key", ExpiringValue.class)).thenReturn(value);

    // WHEN trying to get a cached response for the key
    final String result = cache.get("key");

    // THEN the result is not null
    assertThat(result, is("hello"));
    // and the value has not been evicted from the cache
    verify(springCache, never()).evict("key");
}

From source file:com.inkubator.hrm.web.personalia.SystemScoringFormController.java

@PostConstruct
@Override/*from w  w  w .j  av a  2 s  .  c om*/
public void initialization() {
    super.initialization();
    try {
        String systemScoringId = FacesUtil.getRequestParameter("systemScoringId");
        model = new SystemScoringModel();
        isUpdate = Boolean.FALSE;
        if (StringUtils.isNotEmpty(systemScoringId)) {
            SystemScoring systemScoring = service.getEntiyByPK(Long.parseLong(systemScoringId));
            if (systemScoring != null) {
                model = getModelFromEntity(systemScoring);
                isUpdate = Boolean.TRUE;
            }
        }

    } catch (Exception e) {
        LOGGER.error("Error", e);
    }
}

From source file:com.sirti.microservice.hbase.service.HKpiService.java

public HKpiResultSet findFilterAlarms(String filter) {
    HKpiResultSet hkpiresultset = new HKpiResultSet();

    try {// www. j  a  v a  2  s  . c  om
        long starttime = System.nanoTime();
        List<HKpi> hkpilist = hKpiDao.findFilterHKpi(filter);
        long endtime = System.nanoTime();
        hkpiresultset.setHKpiList(hkpilist);
        hkpiresultset.setDuration((endtime - starttime) / 1000000);
        hkpiresultset.setError(Boolean.FALSE);
    } catch (Exception e) {
        hkpiresultset.setError(Boolean.TRUE);
        hkpiresultset.setErrorMsg(e.getLocalizedMessage());
    }
    return hkpiresultset;
}

From source file:com.codenvy.cas.util.LdapUtils.java

/**
 * Reads a Boolean value from the LdapEntry.
 *
 * @param ctx       the ldap entry/*from  w  w w. ja v  a2s . com*/
 * @param attribute the attribute name
 * @return <code>true</code> if the attribute's value matches (case-insensitive) <code>"true"</code>, otherwise false
 */
public static Boolean getBoolean(final LdapEntry ctx, final String attribute) {
    return getBoolean(ctx, attribute, Boolean.FALSE);
}

From source file:hr.fer.zemris.vhdllab.platform.support.OSBasedUIManagerConfigurer.java

@Override
protected void doInstallCustomDefaults() throws Exception {
    if (System.getProperty("os.name").equals("Linux")) {
        try {/*w  w  w. java2  s  .c  om*/
            installJGoodiesLooks();
        } catch (UnsupportedLookAndFeelException e) {
            UIManager.setLookAndFeel(UIManager.getCrossPlatformLookAndFeelClassName());
            UIManager.put("swing.boldMetal", Boolean.FALSE);
        }
    } else {
        UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
    }
}

From source file:com.omertron.omdbapi.TestLogger.java

/**
 * configure the logger with a simple in-memory file for the required log level
 *
 * @param level The logging level required
 * @return True if successful/*from  www.  j  a  va 2s . c  om*/
 */
public static boolean configure(String level) {
    StringBuilder config = new StringBuilder("handlers = java.util.logging.ConsoleHandler\n");
    config.append(".level = ").append(level).append(CRLF);
    config.append("java.util.logging.ConsoleHandler.level = ").append(level).append(CRLF);
    // Only works with Java 7 or later
    config.append("java.util.logging.SimpleFormatter.format = [%1$tH:%1$tM:%1$tS %4$6s] %2$s - %5$s %6$s%n")
            .append(CRLF);
    // Exclude logging messages
    config.append("org.apache.http.level = SEVERE").append(CRLF);

    InputStream ins = new ByteArrayInputStream(config.toString().getBytes());
    try {
        LogManager.getLogManager().readConfiguration(ins);
        // Exclude http logging
        System.setProperty("org.apache.commons.logging.Log", "org.apache.commons.logging.impl.SimpleLog");
        System.setProperty("org.apache.commons.logging.simplelog.log.org.apache.http", "warn");

    } catch (IOException ex) {
        LOG.warn("Failed to configure log manager due to an IO problem", ex);
        return Boolean.FALSE;
    } finally {
        try {
            ins.close();
        } catch (IOException ex) {
            LOG.info("Failed to close input stream", ex);
        }
    }
    LOG.debug("Logger initialized to '{}' level", level);
    return Boolean.TRUE;
}

From source file:com.omertron.yamjtrakttv.model.Episode.java

public Episode(int season, int episode) {
    this.season = season;
    this.episode = episode;
    this.watched = Boolean.FALSE;
    this.watchedDate = null;
}

From source file:de.appsolve.padelcampus.utils.PlayerUtil.java

public void markAsDeleted(Player user) {
    user.setDeleted(Boolean.TRUE);
    user.setAllowEmailContact(Boolean.FALSE);
    List<Team> teams = teamDAO.findByPlayer(user);
    if (teams != null) {
        for (Team team : teams) {
            team.setName(TeamUtil.getTeamName(team));
            teamDAO.saveOrUpdate(team);/*from ww w  .j a  va 2s  .c om*/
        }
    }
    playerDAO.saveOrUpdate(user);
}

From source file:com.inkubator.hrm.web.personalia.OhsaCategoryFormController.java

@PostConstruct
@Override//ww  w.ja  va 2  s .  c  om
public void initialization() {
    super.initialization();
    try {
        String ohsaCategoryId = FacesUtil.getRequestParameter("ohsaCategoryId");
        model = new OhsaCategoryModel();
        isUpdate = Boolean.FALSE;
        if (StringUtils.isNotEmpty(ohsaCategoryId)) {
            OhsaCategory ohsaCategory = service.getEntiyByPK(Long.parseLong(ohsaCategoryId));
            if (ohsaCategoryId != null) {
                model = getModelFromEntity(ohsaCategory);
                isUpdate = Boolean.TRUE;
            }
        }
    } catch (Exception e) {
        LOGGER.error("Error", e);
    }
}

From source file:net.jofm.format.BooleanFormat.java

@Override
protected Object doParse(String value, Class<?> destinationClazz) {
    if (value.startsWith(trueStr)) {
        return Boolean.TRUE;
    } else {/* w  w w .j av  a  2s. c o  m*/
        return Boolean.FALSE;
    }
}