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:Main.java

/**
 * Flatten a boolean[] into an XmlSerializer.  The list can later be read back
 * with readThisBooleanArrayXml().//from   w  w w  . j  a  v a2s.c  o m
 *
 * @param val  The boolean array to be flattened.
 * @param name Name attribute to include with this array's tag, or null for
 *             none.
 * @param out  XmlSerializer to write the array into.
 * @see #writeMapXml
 * @see #writeValueXml
 * @see #readThisIntArrayXml
 */
public static final void writeBooleanArrayXml(boolean[] val, String name, XmlSerializer out)
        throws XmlPullParserException, IOException {

    if (val == null) {
        out.startTag(null, "null");
        out.endTag(null, "null");
        return;
    }

    out.startTag(null, "boolean-array");
    if (name != null) {
        out.attribute(null, "name", name);
    }

    final int N = val.length;
    out.attribute(null, "num", Integer.toString(N));

    for (int i = 0; i < N; i++) {
        out.startTag(null, "item");
        out.attribute(null, "value", Boolean.toString(val[i]));
        out.endTag(null, "item");
    }

    out.endTag(null, "boolean-array");
}

From source file:ext.paycenter.PCClient.java

/**
 * //w  w w  .j  a  v a 2s .c o m
 * 
 * @param token token
 * @param email ?
 * @param payment ????
 * @param serveduration ?
 * @param isIgnoreLocked ??true - ? false - ??
 * @return
 */
public static PCResult<Void> transferax(String token, String email, String payment, String serveduration,
        boolean ignoreLocked) {
    String post = postNullIgnore("/pay/payment/transferax", "pay_user.token", token, "incom_user.email", email,
            "payment", payment, "serveduration", serveduration, "ignoreLocked", Boolean.toString(ignoreLocked));

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

From source file:com.dubture.symfony.core.preferences.ProjectOptions.java

public static final boolean setSupportingTwig(boolean value, IProject project) {
    return CorePreferencesSupport.getInstance().setProjectSpecificPreferencesValue(Keys.TWIG_SUPPORT,
            Boolean.toString(value), project);
}

From source file:gobblin.runtime.EmailNotificationJobListener.java

@Override
public void onJobCompletion(JobState jobState) {
    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);//www  .j a va  2s.c o  m
            } 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:com.haulmont.chile.core.datatypes.impl.BooleanDatatype.java

@Override
public String format(Object value) {
    return value == null ? "" : Boolean.toString((Boolean) value);
}

From source file:edu.kit.dama.staging.util.TransferClientPropertiesUtils.java

/**
 * Helper method to convert TransferClientProperties object to a map of
 * key-value pairs./*w w w.ja va  2 s  . com*/
 *
 * @param pProperties A TransferClientProperties object.
 *
 * @return A map representing pProperties.
 */
public static Map<String, String> propertiesToMap(TransferClientProperties pProperties) {
    Map<String, String> result = new HashMap<>();
    //add standard properties
    result.put(STAGING_ACCESS_POINT_KEY, pProperties.getStagingAccessPointId());
    result.put(STAGING_URL_KEY, pProperties.getStagingUrl());
    result.put(CLIENT_ACCESS_URL_KEY, pProperties.getTransferClientUrl());
    result.put(MAIL_NOTIFICATION_KEY, Boolean.toString(pProperties.isSendMailNotification()));
    result.put(MAIL_RECEIVER_KEY, pProperties.getReceiverMail());
    result.put(API_KEY_KEY, pProperties.getApiKey());
    result.put(API_SECRET_KEY, pProperties.getApiSecret());

    if (!pProperties.getProcessors().isEmpty()) {
        StringBuilder processors = new StringBuilder();
        for (StagingProcessor processor : pProperties.getProcessors()) {
            processors.append(processor.getUniqueIdentifier()).append(";");
        }
        result.put(PROCESSOR_KEY, processors.toString());
    }

    //add custom properties
    for (String key : pProperties.getPropertyKeys()) {
        if (key != null) {
            result.put(key, pProperties.getCustomProperty(key));
        }
    }

    return result;
}

From source file:com.spectralogic.ds3contractcomparator.print.utils.SimplePrinterUtils.java

/**
 * Prints a line denoting that the specified value existed in the
 * older contract but not in the newer contract. The value "N/A" is
 * used to denote the absence of the value in the newer contract column.
 * @param label The label denoting what category is being printed
 * @param oldVal The deleted value//  www. j a  v a  2  s.c o m
 */
public static void printDeletedLine(final String label, final boolean oldVal, final int indent,
        final WriterHelper writer) {
    printDeletedLine(label, Boolean.toString(oldVal), indent, writer);
}

From source file:gov.nih.nci.calims2.taglib.form.DateTextBoxTag.java

/**
 * {@inheritDoc}/*from w  w  w .  j  a v a2  s. c o  m*/
 */
protected Tag createTag() {
    Tag tag = new CompositeTag(HtmlElement.DIV);
    tag.addAttribute("dojoType", DojoType.DIJIT_FORM_DATE_TEXTBOX.getTypeName());
    addAttributes(tag);
    addMessages(tag);
    tag.addAttribute("constraints", getConstraints());
    tag.addAttribute("required", Boolean.toString(isRequired()));
    tag.addAttribute("formatLength", formatLength);
    tag.addAttribute("datePattern", getPattern());
    tag.addAttribute("strict", Boolean.toString(strict));
    tag.addAttribute("value", getIsoValue());
    return tag;
}

From source file:br.com.great.resource.ServidorResource.java

/**
 * Start o servidor dos jogos//from w  w w  .  j a va2  s.c  o  m
 * @return String Informando se True ou False
 */
@GET
@Path("/startServidor")
@Produces("application/json")
public String startServidor() {
    return Boolean.toString(ServidorJogo.getInstance().StartServidor());
}

From source file:org.mule.module.http.functional.listener.HttpListenerExpressionFilterTestCase.java

private void sendRequestAndAssertResponse(boolean filterExpression, String expectedBody) throws IOException {
    Request request = Request.Post(String.format("http://localhost:%s", listenPort.getValue()))
            .body(new StringEntity(TEST_MESSAGE))
            .addHeader("filterExpression", Boolean.toString(filterExpression));

    HttpResponse response = request.execute().returnResponse();

    assertThat(response.getStatusLine().getStatusCode(), equalTo(200));
    assertThat(IOUtils.toString(response.getEntity().getContent()), equalTo(expectedBody));
}