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.predic8.membrane.core.config.Proxy.java

@Override
public void write(XMLStreamWriter out) throws XMLStreamException {
    out.writeStartElement(ELEMENT_NAME);

    out.writeAttribute(ATTRIBUTE_ACTIVE, Boolean.toString(useProxy));

    out.writeAttribute(ATTRIBUTE_AUTHENTICATION, Boolean.toString(useAuthentication));

    new ProxyHost(proxyHost).write(out);

    new ProxyPort(Integer.toString(proxyPort)).write(out);

    new ProxyUsername(proxyUsername).write(out);

    new ProxyPassword(proxyPassword).write(out);

    out.writeEndElement();//ww  w .jav a  2s .  co  m
}

From source file:com.meetingninja.csse.database.TaskDatabaseAdapter.java

public static Task createTask(Task t) throws IOException {
    String _url = getBaseUri().build().toString();
    URL url = new URL(_url);
    HttpURLConnection conn = (HttpURLConnection) url.openConnection();

    // add request header
    conn.setRequestMethod(IRequest.POST);
    addRequestHeader(conn, false);//from   w  w  w.  j ava 2 s .  com
    ByteArrayOutputStream json = new ByteArrayOutputStream();
    // this type of print stream allows us to get a string easily
    PrintStream ps = new PrintStream(json);
    // Create a generator to build the JSON string
    JsonGenerator jgen = JFACTORY.createGenerator(ps, JsonEncoding.UTF8);
    // Build JSON Object for Title
    jgen.writeStartObject();
    jgen.writeStringField(Keys.Task.TITLE, t.getTitle());
    jgen.writeStringField(Keys.Task.COMPLETED, Boolean.toString(t.getIsCompleted()));
    jgen.writeStringField(Keys.Task.DESC, t.getDescription());
    jgen.writeStringField(Keys.Task.DEADLINE, Long.toString(t.getEndTimeInMillis()));
    jgen.writeStringField(Keys.Task.DATE_CREATED, t.getDateCreated());
    jgen.writeStringField(Keys.Task.DATE_ASSIGNED, t.getDateAssigned());
    jgen.writeStringField(Keys.Task.CRITERIA, t.getCompletionCriteria());
    jgen.writeStringField(Keys.Task.ASSIGNED_TO, t.getAssignedTo());
    jgen.writeStringField(Keys.Task.ASSIGNED_FROM, t.getAssignedFrom());
    jgen.writeStringField(Keys.Task.CREATED_BY, t.getCreatedBy());
    jgen.writeEndObject();
    jgen.close();

    String payload = json.toString("UTF8");
    ps.close();
    // Get server response
    sendPostPayload(conn, payload);
    String response = getServerResponse(conn);
    Map<String, String> responseMap = new HashMap<String, String>();
    if (responseMap.containsKey(Keys.Task.ID)) {
        t.setID(responseMap.get(Keys.Task.ID));
    }
    return t;
}

From source file:org.openeos.jbpm.integration.internal.KnowledgeManager.java

public StatefulKnowledgeSession createSession() {
    System.setProperty("jbpm.enable.multi.con", Boolean.toString(true));
    Properties props = new Properties();
    props.put("drools.processInstanceManagerFactory", JPAProcessInstanceManagerFactory.class.getName());
    props.put("drools.workItemManagerFactory", JPAWorkItemManagerFactory.class.getName());
    props.put("drools.processSignalManagerFactory", JPASignalManagerFactory.class.getName());

    KnowledgeSessionConfiguration ksconf = KnowledgeBaseFactory.newKnowledgeSessionConfiguration(props);

    Environment env = KnowledgeBaseFactory.newEnvironment();
    env.set(EnvironmentName.PERSISTENCE_CONTEXT_MANAGER, processPersistenceContextManager);

    AnnotationTransactionAspect txAspect = AnnotationTransactionAspect.aspectOf();
    AbstractPlatformTransactionManager txManager = (AbstractPlatformTransactionManager) txAspect
            .getTransactionManager();//from   www.  ja  va  2  s  .c  o  m
    LOG.debug("Transaction manager: " + txManager.toString());
    TransactionManager tm = new UnoTransactionManager(txManager,
            (UnoProcessPersistenceContext) processPersistenceContextManager.getProcessPersistenceContext());
    env.set(EnvironmentName.TRANSACTION_MANAGER, tm);

    Integer sessionId = knowledgeIdResolver.getKnowledgeSessionId();
    SingleSessionCommandService sscs;
    KnowledgeBase kBase = knowledgeBaseProvider.getKnowledgeBase();
    if (sessionId == null) {
        sscs = new SingleSessionCommandService(kBase, ksconf, env);
        knowledgeIdResolver.saveKnowledgeSessionId(sscs.getSessionId());
    } else {
        sscs = new SingleSessionCommandService(sessionId, kBase, ksconf, env);
    }
    return new CommandBasedStatefulKnowledgeSession(sscs);

}

From source file:org.talend.dataprep.api.service.command.dataset.DataSetPreview.java

private HttpRequestBase onExecute(String dataSetId, boolean metadata, String sheetName) {
    try {//from w w  w . j a v  a 2  s .c  o  m

        URIBuilder uriBuilder = new URIBuilder(datasetServiceUrl + "/datasets/" + dataSetId + "/preview/");
        uriBuilder.addParameter("metadata", Boolean.toString(metadata));
        if (StringUtils.isNotEmpty(sheetName)) {
            // yup this sheet name can contains weird characters space, great french accents or even chinese
            // characters
            uriBuilder.addParameter("sheetName", sheetName);
        }
        return new HttpGet(uriBuilder.build());
    } catch (URISyntaxException e) {
        throw new TDPException(CommonErrorCodes.UNEXPECTED_EXCEPTION, e);
    }
}

From source file:count.ly.messaging.CrashDetails.java

/**
 * Returns app background state
 */
static String isInBackground() {
    return Boolean.toString(inBackground);
}

From source file:com.amazonaws.services.kinesis.producer.KinesisProducerConfigurationTest.java

@Test
public void loadBoolean() {
    KinesisProducerConfiguration defaultConfig = new KinesisProducerConfiguration();
    Properties p = new Properties();
    boolean v = !defaultConfig.isVerifyCertificate();
    p.setProperty("VerifyCertificate", Boolean.toString(v));
    KinesisProducerConfiguration cfg = KinesisProducerConfiguration.fromPropertiesFile(writeFile(p));
    assertEquals(v, cfg.isVerifyCertificate());
}

From source file:com.twinsoft.convertigo.engine.util.CookiesUtils.java

public static void addCookie(HttpState httpState, String domain, String name, String value, String path,
        Date expires, boolean secure) {
    Cookie cookie = null;//from www .j a  v  a 2  s . c o  m
    try {
        Engine.logBeans.debug(String.format(
                "(CookiesUtils) Adding cookie: "
                        + "domain=%s, name=%s, value=%s, path=%s, expires=%s, secure=%s",
                domain, name, value, path, expires.toString(), Boolean.toString(secure)));

        cookie = new Cookie(domain, name, value, path, expires, secure);
        if (cookie != null) {
            Engine.logBeans.debug("(CookiesUtils) added cookie: " + cookie);
            httpState.addCookie(cookie);
        }
    } catch (Exception e) {
        Engine.logBeans.debug("(CookiesUtils) failed to parse cookie: " + cookie);
    }
}

From source file:com.autentia.wuija.trace.persistence.OperationalTraceBuilder.java

public static OperationalTraceParams generateParam(String paramName, Operator operator, boolean param) {
    return generateParam(paramName, operator, Boolean.toString(param));
}

From source file:gobblin.runtime.EmailNotificationJobListener.java

@Override
public void onJobCancellation(JobState jobState) {
    boolean notificationEmailEnabled = Boolean.valueOf(
            jobState.getProp(ConfigurationKeys.NOTIFICATION_EMAIL_ENABLED_KEY, Boolean.toString(false)));

    if (notificationEmailEnabled) {
        try {//from  ww  w . jav  a2s .c  o m
            EmailUtils.sendJobCancellationEmail(jobState.getJobId(), jobState.toString(), jobState);
        } catch (EmailException ee) {
            LOGGER.error("Failed to send job cancellation notification email for job " + jobState.getJobId(),
                    ee);
        }
    }
}

From source file:com.hyphenated.pokerplayerclient.network.RestRequestBuilder.java

@Override
public void addParameter(String paramName, boolean paramValue) {
    addParameter(paramName, Boolean.toString(paramValue));
}