Example usage for java.lang Boolean TRUE

List of usage examples for java.lang Boolean TRUE

Introduction

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

Prototype

Boolean TRUE

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

Click Source Link

Document

The Boolean object corresponding to the primitive value true .

Usage

From source file:it.geosolutions.geoserver.jms.events.ToggleSwitch.java

public void enable() {
    if (isToggleEnabled()) {
        ctx.publishEvent(new ToggleEvent(Boolean.TRUE, toggleType));
    }
}

From source file:cool.pandora.modeller.BbToolBarCommandButtonConfigurer.java

/**
 * Gets the useLargeIcons.// w w  w .  j a  v  a2s .  c  o m
 *
 * @return the useLargeIcons
 */
private Boolean getUseLargeIcons() {

    if (this.useLargeIcons == null) {
        this.setUseLargeIcons(Boolean.TRUE);
    }

    return this.useLargeIcons;
}

From source file:com.hiperium.web.common.dto.PopupMessageDTO.java

/**
 * /*from www  . j  a  v a2  s.co  m*/
 * @return
 */
public Boolean isEmpty() {
    Boolean res = Boolean.FALSE;
    if (this.severity.equals(FacesMessage.SEVERITY_FATAL)) {
        res = Boolean.TRUE;
    }
    return res;
}

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 w w w  . j av  a2  s. c  om*/
}

From source file:com.gnip.test.YouTubeEDCSerDeTest.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 = YouTubeEDCSerDeTest.class.getResourceAsStream("/YoutubeEDC.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);

    ObjectMapper jsonMapper = new ObjectMapper();

    try {//from w w w.  j a v  a2s.  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:com.inkubator.hrm.web.personalia.SystemScoringFormController.java

@PostConstruct
@Override// w  w  w  .j  a v a  2  s  . c  o m
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.mobileman.projecth.web.util.PatientUtils.java

/**
 * @param model/*from  w w w  .j a  v  a2  s  . co  m*/
 * @param data
 * @param patient
 * @param selectedDisease
 */
public static void loadPatientHeader(Model model, DataHolder data, User patient, Disease selectedDisease) {
    LocaleService localeService = InitController.getWebApplicationContext().getBean(LocaleService.class);
    String patien_name = localeService.getUnknowMessage();
    String patien_surname = localeService.getUnknowMessage();

    Name name = patient.getName();
    if (name != null) {
        patien_name = name.getName();
        patien_surname = name.getSurname();
    }

    model.addAttribute("visitorCanSeeUserData", Boolean.TRUE);
    model.addAttribute("patien_login", patient.getUserAccount().getLogin());

    model.addAttribute("patien_name", patien_name);
    model.addAttribute("patien_surname", patien_surname);

    Pair<Date, Date> diagDates = data.getInitialSymptomAndDaiagnosisDate();
    model.addAttribute("patient_initialsymptomdate", DateUtils.germanLongDate2str(diagDates.getFirst()));
    model.addAttribute("patient_initialdiagnosisdate", DateUtils.germanLongDate2str(diagDates.getSecond()));

    String gend = UserUtil.fmtGender(patient);
    model.addAttribute("patient_gender", gend);
    model.addAttribute("patient_avatar", computeAvatar(patient.getSex()));
    model.addAttribute("patient_age", computeAge(patient.getBirthday()));
    model.addAttribute("patient_place",
            patient.getCountry() != null ? patient.getCountry().getName() : localeService.getUnknownLocation());

    model.addAttribute("patient_logincount", patient.getLoginsCount());
    model.addAttribute("patient_created", DateUtils.germanShortDate2str(patient.getUserAccount().getCreated()));

    model.addAttribute("patient_lastlogin", DateUtils.germanShortDate2str(patient.getLastLogin()));
    model.addAttribute("patient_lastupdate", DateUtils.germanShortDate2str(patient.getLastUpdate()));
    model.addAttribute("patient_my_story", patient.getAboutMe());
    model.addAttribute("user_weight", UserUtils.fmtUserWeight(patient));

    //diseases
    List<Disease> diseases = patient.getDiseases();
    List<DiseaseInfo> diseaseInfo = new ArrayList<DiseaseInfo>();

    Long selectedDiseaseId = selectedDisease == null ? null : selectedDisease.getId();
    for (Disease disease : diseases) {
        diseaseInfo.add(new DiseaseInfo(disease, patient.getId(), selectedDiseaseId));
    }
    model.addAttribute("patient_diseases", diseaseInfo);

    //medications
    model.addAttribute("patient_selected_disease", data.getDisease());

    if (selectedDiseaseId != null) {
        model.addAttribute("patient_medications",
                InitController.getWebApplicationContext().getBean(PatientMedicationService.class)
                        .findAllConsumedMedications(patient.getId(), selectedDiseaseId));
    }
}

From source file:com.mycompany.projetsportmanager.spring.configuration.H2ProfileConfiguration.java

/**
 * Returns the Generate DDL flag.
 * @return the Generate DDL flag.
 */
@Bean
public Boolean generateDdl() {
    return Boolean.TRUE;
}

From source file:be.fedict.eid.idp.model.applet.ChannelBindingServiceBean.java

@Override
public X509Certificate getServerCertificate() {
    Boolean omitSecureChannelBinding = this.configuration.getValue(ConfigProperty.OMIT_SECURE_CHANNEL_BINDING,
            Boolean.class);
    if (null != omitSecureChannelBinding) {
        if (omitSecureChannelBinding.equals(Boolean.TRUE)) {
            LOG.warn("omitting secure channel binding");
            return null;
        }//from  www. j  a  va2 s  .  co  m
    }
    X509Certificate serverCertificate = this.configuration.getAppletConfig().getServerCertificate();
    if (null == serverCertificate) {
        LOG.warn("secure channel binding not yet configured");
    }
    return serverCertificate;
}

From source file:com.onehippo.gogreen.components.ComponentUtil.java

public static void doRedirectionOnWrongLandingMount(HstRequest request, HstResponse response) {
    HstRequestContext requestContext = request.getRequestContext();

    if (requestContext.getAttribute(REDIRECTION_ON_WRONG_LANDING_MOUNT_DONE_ATTR) != null) {
        return;//from  w ww.j  a  v  a  2 s .  c o  m
    }

    requestContext.setAttribute(REDIRECTION_ON_WRONG_LANDING_MOUNT_DONE_ATTR, Boolean.TRUE);

    boolean isMobileUserAgent = UserAgentUtils.isMobile(request);
    ResolvedMount resolvedMount = requestContext.getResolvedMount();
    boolean isMountForMobile = resolvedMount.getMount().isOfType(DEFAULT_MOUNT_TYPE_MOBILE);

    if (!isMountForMobile) {
        for (String type : resolvedMount.getMount().getTypes()) {
            if (StringUtils.contains(type, DEFAULT_MOUNT_TYPE_MOBILE)) {
                isMountForMobile = true;
                break;
            }
        }
    }

    if (isMobileUserAgent && !isMountForMobile) {
        if (log.isDebugEnabled()) {
            log.debug("Redirecting to mobile mount for User-Agent: '{}'.", request.getHeader("User-Agent"));
        }
        sendRedirectToMount(request, response, DEFAULT_MOUNT_ALIAS_MOBILE);
    }
}