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:com.inkubator.hrm.web.personalia.BioPotensiSwotFormController.java

@PostConstruct
@Override/* w  w w  .  ja v  a 2  s  . c  o m*/
public void initialization() {
    super.initialization();
    try {
        String bioPotensiSwotId = FacesUtil.getRequestParameter("bioPotensiSwotId");
        bioDataId = Long.parseLong(FacesUtil.getRequestParameter("bioDataId"));
        model = new BioPotensiSwotModel();
        isUpdate = Boolean.FALSE;
        if (StringUtils.isNotEmpty(bioPotensiSwotId)) {
            BioPotensiSwot bioPotensiSwot = service.getEntiyByPK(Long.parseLong(bioPotensiSwotId));
            if (bioPotensiSwotId != null) {
                model = getModelFromEntity(bioPotensiSwot);
                isUpdate = Boolean.TRUE;
            }
        }

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

From source file:net.opentsdb.contrib.tsquare.web.view.AbstractJsonResponseWriter.java

@Override
public void beginResponse(final ResponseContext context) throws IOException {
    context.getResponse().setContentType(contentType);

    final OutputStream out = context.getResponse().getOutputStream();
    final JsonGenerator json = new JsonFactory().createGenerator(out);
    context.putProperty("jsonGenerator", json);

    // By default.
    context.putProperty("isJsonpResponse", Boolean.FALSE);

    if (jsonpAllowed) {
        final boolean hasParams = context.getRequest().getParameterMap().containsKey(jsonpRequestParam);

        if (hasParams) {
            context.putProperty("isJsonpResponse", Boolean.TRUE);

            final String jsonpValue = context.getRequest().getParameter(jsonpRequestParam);
            if (!Strings.isNullOrEmpty(jsonpValue)) {
                json.writeRaw(jsonpValue);
            }//from w  w  w  .j a va  2s  .c o m

            json.writeRaw('('); // START of jsonp response wrapper.
        }
    }
}

From source file:com.ankang.report.pool.AbstractReportAliasPool.java

protected final <T> boolean mount(String alias, T aliasClass) {
    if (StringUtils.isEmpty(alias)) {
        logger.error("alias can't be empty");
        return Boolean.FALSE;
    }/*from w ww  .  j  a  va  2s  .c om*/
    if (null == waitMap) {
        logger.error("aliasClass can't be empty");
        return Boolean.FALSE;
    }
    synchronized (waitMap) {

        if (waitMap.containsKey(alias)) {
            logger.error("duplicate alias : " + alias);
            return Boolean.FALSE;
        }
        waitMap.put(alias, aliasClass);
        return Boolean.TRUE;
    }
}

From source file:com.enonic.cms.core.structure.SiteProperties.java

public Boolean getPropertyAsBoolean(final SitePropertyNames key) {
    String svalue = properties.getProperty(key.getKeyName());

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

From source file:org.apache.streams.gnip.flickr.test.FlickrEDCSerDeTest.java

@Test
public void Tests() throws Exception {
    mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, Boolean.FALSE);
    mapper.configure(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY, Boolean.TRUE);
    mapper.configure(DeserializationFeature.ACCEPT_EMPTY_STRING_AS_NULL_OBJECT, Boolean.TRUE);

    InputStream is = FlickrEDCSerDeTest.class.getResourceAsStream("/FlickrEDC.xml");
    if (is == null)
        System.out.println("null");
    InputStreamReader isr = new InputStreamReader(is);
    BufferedReader br = new BufferedReader(isr);
    XmlMapper xmlMapper = new XmlMapper();
    xmlMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, Boolean.FALSE);
    xmlMapper.configure(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY, Boolean.TRUE);
    xmlMapper.configure(DeserializationFeature.ACCEPT_EMPTY_STRING_AS_NULL_OBJECT, Boolean.TRUE);
    xmlMapper.configure(DeserializationFeature.FAIL_ON_INVALID_SUBTYPE, Boolean.FALSE);

    ObjectMapper jsonMapper = new ObjectMapper();

    try {//from  w  ww.  j  a  v  a2 s  .c  om
        while (br.ready()) {
            String line = br.readLine();
            //LOGGER.debug(line);

            Object activityObject = xmlMapper.readValue(line, Object.class);

            String jsonObject = jsonMapper.writeValueAsString(activityObject);

            //LOGGER.debug(jsonObject);
        }
    } catch (Exception e) {
        e.printStackTrace();
        Assert.fail();
    }
}

From source file:net.sourceforge.fenixedu.domain.Branch.java

public Boolean representsCommonBranch() {
    if (getBranchType() != null && getBranchType().equals(BranchType.COMNBR)) {
        return Boolean.TRUE;
    }//from w w w .j a v  a2  s.  co m
    return Boolean.FALSE;
}

From source file:org.trustedanalytics.user.invite.securitycode.RedisSecurityCodeServiceTest.java

@Test
public void shouldRetryAndSucceed() {
    when(redisOps.<String, SecurityCode>opsForHash()).thenReturn(hashOps);
    when(hashOps.putIfAbsent(anyString(), anyString(), any(SecurityCode.class))).thenReturn(Boolean.FALSE)
            .thenReturn(Boolean.FALSE).thenReturn(Boolean.TRUE);

    RedisStore<SecurityCode> redisStore = new RedisStore<>(redisOps, "test-key");
    SecurityCodeService service = new SecurityCodeService(redisStore);
    SecurityCode code = service.generateCode("test@example.com");

    assertThat(code.getCode(), not(isEmptyOrNullString()));
    ArgumentCaptor<SecurityCode> codeCaptor = ArgumentCaptor.forClass(SecurityCode.class);
    verify(hashOps, times(3)).putIfAbsent(anyString(), anyString(), codeCaptor.capture());

    //check that all generated codes were different
    assertThat("Expected 3 different values for generated codes",
            new HashSet<String>(codeCaptor.getAllValues().stream().map(x -> x.getCode()).collect(toList())),
            hasSize(3));/*from   www .  j a  v  a  2s .com*/
}

From source file:com.inkubator.hrm.web.organisation.CompanyOwnershipFormController.java

@PostConstruct
@Override/* ww w . j av a  2  s .  c om*/
public void initialization() {
    super.initialization();
    try {
        String companyId = FacesUtil.getRequestParameter("companyId");
        model = new CompanyOwnershipModel();
        isUpdate = Boolean.FALSE;
        String ownershipId = FacesUtil.getRequestParameter("ownershipId");
        if (StringUtils.isNotEmpty(ownershipId)) {
            CompanyOwnership companyOwnership = companyOwnershipService
                    .getEntiyByPK(Long.parseLong(ownershipId));
            if (companyOwnership != null) {
                model = getModelFromEntity(companyOwnership);
                isUpdate = Boolean.TRUE;
            }
        }

        model.setCompanyId(Long.parseLong(companyId));
    } catch (Exception e) {
        LOGGER.error("Error", e);
    }
}

From source file:org.urlshortener.core.converter.UrlShortenerMessageConverter.java

/**
 * {@inheritDoc}
 */
public boolean canWrite(Class<?> clazz, MediaType mediaType) {
    return Boolean.FALSE;
}

From source file:uk.ac.aber.raf8.mmp.core.jobs.YQLCacheIndustryQueryJob.java

@Override
protected void executeInternal(final JobExecutionContext jobExecutionContext) throws JobExecutionException {

    final YQLIndustryQueryModel industryQueryModel = new YQLIndustryQueryModel();
    final YQLSectorsQueryModel sectorsQueryModel = YQLQueryCache.getInstance().getYQLSectorsQueryModel();

    for (final YQLSectorModel sectorModel : sectorsQueryModel.getSectorModels()) {
        Boolean success = Boolean.FALSE;
        Integer tries = 0;// ww  w  . j  a v  a2s. c  om
        while (!success && tries < MAX_TRIES) {
            try {
                final YQLIndustryQueryModel temp = YQLService.getInstance()
                        .getYQLIndustryQueryModel(sectorModel.getIndustryModels());
                industryQueryModel.getIndustryModels().addAll(temp.getIndustryModels());
                success = Boolean.TRUE;
            } catch (final Exception e) {
                e.printStackTrace();
                tries++;
                try {
                    Thread.sleep(DELAY_BETWEEN_TRIES);
                } catch (final InterruptedException e1) {
                    e1.printStackTrace();
                }
            }
        }
    }

    YQLQueryCache.getInstance().setYQLIndustryQueryModel(industryQueryModel);
}