Example usage for org.apache.commons.lang3.builder ToStringStyle SHORT_PREFIX_STYLE

List of usage examples for org.apache.commons.lang3.builder ToStringStyle SHORT_PREFIX_STYLE

Introduction

In this page you can find the example usage for org.apache.commons.lang3.builder ToStringStyle SHORT_PREFIX_STYLE.

Prototype

ToStringStyle SHORT_PREFIX_STYLE

To view the source code for org.apache.commons.lang3.builder ToStringStyle SHORT_PREFIX_STYLE.

Click Source Link

Document

The short prefix toString style.

Usage

From source file:gobblin.writer.http.SalesforceRestWriter.java

private HttpUriRequest newRequest(RequestBuilder builder, JsonElement payload) {
    try {//from  w  ww .ja va  2  s.c o  m
        builder.addHeader(HttpHeaders.CONTENT_TYPE, ContentType.APPLICATION_JSON.getMimeType())
                .addHeader(HttpHeaders.AUTHORIZATION, "OAuth " + accessToken)
                .setEntity(new StringEntity(payload.toString(), ContentType.APPLICATION_JSON));
    } catch (Exception e) {
        throw new RuntimeException(e);
    }
    if (getLog().isDebugEnabled()) {
        getLog().debug("Request builder: "
                + ToStringBuilder.reflectionToString(builder, ToStringStyle.SHORT_PREFIX_STYLE));
    }
    return builder.build();
}

From source file:com.norconex.collector.http.delay.impl.AbstractDelayResolver.java

@Override
public String toString() {
    return new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE).append("defaultDelay", defaultDelay)
            .append("ignoreRobotsCrawlDelay", ignoreRobotsCrawlDelay).append("scope", scope).toString();
}

From source file:eu.openanalytics.rsb.Util.java

/**
 * Marshals an {@link ErrorResult} to XML.
 * //  www.  j a  va 2 s.  c  om
 * @param errorResult
 * @return
 */
public static String toXml(final ErrorResult errorResult) {
    try {
        final Marshaller marshaller = ERROR_RESULT_JAXB_CONTEXT.createMarshaller();
        final StringWriter sw = new StringWriter();
        marshaller.marshal(errorResult, sw);
        return sw.toString();
    } catch (final JAXBException je) {
        final String objectAsString = ToStringBuilder.reflectionToString(errorResult,
                ToStringStyle.SHORT_PREFIX_STYLE);
        throw new RuntimeException("Failed to XML marshall: " + objectAsString, je);
    }
}

From source file:ca.uhn.fhir.model.api.BundleEntry.java

@Override
public String toString() {
    ToStringBuilder b = new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE);
    if (getResource() != null) {
        b.append("type", getResource().getClass().getSimpleName());
    } else {/*from   ww  w. j  a  v  a  2 s. c  om*/
        b.append("No resource");
    }
    b.append("id", getId());
    return b.toString();
}

From source file:com.gs.obevo.api.appdata.ChangeInput.java

@Override
public String toString() {
    return new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE).append("changeKey", changeKey)
            .append("includeDependencies", includeDependencies)
            .append("excludeDependencies", excludeDependencies).append("fileLocation", fileLocation)
            .append("dependencies", dependencies)
            .append("contentForDependencyCalculation", contentForDependencyCalculation)
            .append("content", content).append("convertedContent", convertedContent)
            .append("rollbackContent", rollbackContent)
            .append("convertedRollbackContent", convertedRollbackContent).append("rerunnable", rerunnable)
            .append("restrictions", restrictions).append("permissionScheme", permissionScheme)
            .append("order", order).append("metadataSection", metadataSection)
            .append("dropContent", dropContent)
            .append("rollbackIfAlreadyDeployedContent", rollbackIfAlreadyDeployedContent)
            .append("active", active).append("orderWithinObject", orderWithinObject)
            .append("baselinedChanges", baselinedChanges).append("parallelGroup", parallelGroup)
            .append("drop", drop).append("keepIncrementalOrder", keepIncrementalOrder)
            .append("applyGrants", applyGrants).append("changeset", changeset)
            .append("contentHash", contentHash).toString();
}

From source file:com.norconex.collector.http.crawler.event.impl.URLStatusCrawlerEventListener.java

@Override
public String toString() {
    return new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE).append("statusCodes", statusCodes)
            .append("outputDir", outputDir).append("fileNamePrefix", fileNamePrefix)
            .append("outputFile", outputFile).append("parsedCodes", parsedCodes).toString();
}

From source file:eu.openanalytics.rsb.Util.java

/**
 * Marshals an {@link Object} to a JSON string.
 * /*  w w w.  j  av a2 s.  com*/
 * @param o
 * @return
 */
public static String toJson(final Object o) {
    try {
        return PRETTY_JSON_OBJECT_MAPPER.writeValueAsString(o);
    } catch (final IOException ioe) {
        final String objectAsString = ToStringBuilder.reflectionToString(o, ToStringStyle.SHORT_PREFIX_STYLE);
        throw new RuntimeException("Failed to JSON marshall: " + objectAsString, ioe);
    }
}

From source file:com.github.koraktor.steamcondenser.community.SteamGame.java

@Override
public String toString() {
    return new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE).append("appId", this.appId)
            .append("name", this.name).append("shortName", this.shortName).toString();
}

From source file:ca.uhn.fhir.rest.param.QuantityParam.java

@Override
public String toString() {
    ToStringBuilder b = new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE);
    b.append("prefix", getPrefix());
    b.append("value", myValue);
    b.append("system", mySystem);
    b.append("units", myUnits);
    if (getMissing() != null) {
        b.append("missing", getMissing());
    }//from w  ww  .j  a va  2s .com
    return b.toString();
}

From source file:eu.openanalytics.rsb.Util.java

/**
 * Marshals an {@link Object} to a pretty-printed JSON file.
 * //w  ww  . ja v a2  s.  c o m
 * @param o
 * @throws IOException
 */
public static void toPrettyJsonFile(final Object o, final File f) throws IOException {
    try {
        PRETTY_JSON_OBJECT_MAPPER.writeValue(f, o);
    } catch (final JsonProcessingException jpe) {
        final String objectAsString = ToStringBuilder.reflectionToString(o, ToStringStyle.SHORT_PREFIX_STYLE);
        throw new RuntimeException("Failed to JSON marshall: " + objectAsString, jpe);
    }
}