Example usage for java.lang Boolean toString

List of usage examples for java.lang Boolean toString

Introduction

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

Prototype

public static String toString(boolean b) 

Source Link

Document

Returns a String object representing the specified boolean.

Usage

From source file:com.netflix.discovery.converters.jackson.InstanceInfoJsonBeanSerializer.java

@Override
protected void serializeFields(Object bean, JsonGenerator jgen0, SerializerProvider provider)
        throws IOException {
    super.serializeFields(bean, jgen0, provider);
    InstanceInfo instanceInfo = (InstanceInfo) bean;

    jgen0.writeFieldName("port");
    jgen0.writeStartObject();//  ww w .  ja va2  s  .c o  m
    jgen0.writeNumberField("$", instanceInfo.getPort());
    jgen0.writeStringField("@enabled", Boolean.toString(instanceInfo.isPortEnabled(PortType.UNSECURE)));
    jgen0.writeEndObject();

    jgen0.writeFieldName("securePort");
    jgen0.writeStartObject();
    jgen0.writeNumberField("$", instanceInfo.getSecurePort());
    jgen0.writeStringField("@enabled", Boolean.toString(instanceInfo.isPortEnabled(PortType.SECURE)));
    jgen0.writeEndObject();
}

From source file:no.digipost.api.interceptors.Wss4jHandler.java

Wss4jHandler() {
    // set up default handler properties
    options.setProperty(WSHandlerConstants.MUST_UNDERSTAND, Boolean.toString(true));
    options.setProperty(WSHandlerConstants.ENABLE_SIGNATURE_CONFIRMATION, Boolean.toString(true));
}

From source file:gobblin.runtime.listeners.EmailNotificationJobListener.java

@Override
public void onJobCompletion(JobContext jobContext) {
    JobState jobState = jobContext.getJobState();
    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);/*ww  w  . j a va2  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:Main.java

public static void addBooleanProperty(Document document, Element parent, String name, boolean value) {
    addPropertyNode(document, parent, name).setAttribute(BOOLEAN_ATTR, Boolean.toString(value));
}

From source file:org.lightadmin.logging.configurer.LightConfigurerServletContextInitializer.java

@Override
public void onStartup(ServletContext servletContext) throws ServletException {
    servletContext.setInitParameter(LIGHT_CONFIGURER_BASE_URL, configurerSettings.getApplicationBaseUrl());
    servletContext.setInitParameter(LIGHT_CONFIGURER_BACK_TO_SITE_URL, configurerSettings.getBackToSiteUrl());
    servletContext.setInitParameter(LIGHT_CONFIGURER_DEMO_MODE,
            Boolean.toString(configurerSettings.isDemoMode()));

    new LightConfigurerWebApplicationInitializer().onStartup(servletContext);
}

From source file:it.jugpadova.controllers.EventSearchController.java

@RequestMapping
protected ModelAndView search(@ModelAttribute("eventSearch") EventSearch eventSearch) {
    List<Event> events = eventBo.search(eventSearch);
    ModelAndView mv = new ModelAndView("event/search");
    mv.addObject("events", events);
    mv.addObject("showNoResultsMessage", Boolean.toString(events.isEmpty()));
    return mv;//from   www  . j  a va2s.c om
}

From source file:fr.mycellar.configuration.JavaMelodyConfiguration.java

@Bean
public FilterRegistrationBean javaMelody() {
    FilterRegistrationBean javaMelody = new FilterRegistrationBean();
    javaMelody.setFilter(new MonitoringFilter());
    javaMelody.addInitParameter(Parameter.LOG.getCode(), Boolean.toString(true));
    javaMelody.addUrlPatterns("/*");
    return javaMelody;
}

From source file:com.netflix.discovery.converters.jackson.InstanceInfoXmlBeanSerializer.java

@Override
protected void serializeFields(Object bean, JsonGenerator jgen0, SerializerProvider provider)
        throws IOException {
    super.serializeFields(bean, jgen0, provider);
    InstanceInfo instanceInfo = (InstanceInfo) bean;

    ToXmlGenerator xgen = (ToXmlGenerator) jgen0;

    xgen.writeFieldName("port");
    xgen.writeStartObject();//from w  ww .j  a va2  s .c om
    xgen.setNextIsAttribute(true);
    xgen.writeStringField("enabled", Boolean.toString(instanceInfo.isPortEnabled(PortType.UNSECURE)));
    xgen.setNextIsAttribute(false);
    xgen.setNextIsUnwrapped(true);
    xgen.writeString(Integer.toString(instanceInfo.getPort()));
    xgen.writeEndObject();

    xgen.writeFieldName("securePort");
    xgen.writeStartObject();
    xgen.setNextIsAttribute(true);
    xgen.writeStringField("enabled", Boolean.toString(instanceInfo.isPortEnabled(PortType.SECURE)));
    xgen.setNextIsAttribute(false);
    xgen.setNextIsUnwrapped(true);
    xgen.writeString(Integer.toString(instanceInfo.getSecurePort()));
    xgen.writeEndObject();
}

From source file:no.dusken.aranea.spring.AraneaContextLoaderListener.java

public void addDeveloperModeReplacer(ConfigurableWebApplicationContext wac) {
    PropertyPlaceholderConfigurer configurer = new PropertyPlaceholderConfigurer();
    final Properties properties = new Properties();
    properties.setProperty("developerMode", Boolean.toString(System.getProperty("developerMode") != null));
    configurer.setProperties(properties);
    configurer.setIgnoreUnresolvablePlaceholders(true);
    wac.addBeanFactoryPostProcessor(configurer);
}

From source file:ext.paycenter.PCClient.java

/**
 * //from  w  w w  .ja  v a2 s .c  om
 * 
 * @param email 
 * @param toEmail ?
 * @param payment ????
 * @param serveduration ?
 * @param isIgnoreLocked ??true - ? false - ??
 * @return
 */
public static PCResult<Void> transferByEmail(String email, String toEmail, String payment, String serveduration,
        boolean ignoreLocked) {
    String post = postNullIgnore("/pay/payment/transferByEmail", "pay_user.email", email, "incom_user.email",
            toEmail, "payment", payment, "serveduration", serveduration, "ignoreLocked",
            Boolean.toString(ignoreLocked));

    return PCResult.fromJsonString(post, Void.class, false);
}