Java Code Examples for com.google.common.base.MoreObjects

The following examples show how to use com.google.common.base.MoreObjects. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source Project: agile-service-old   Author: choerodon   File: IssueTypeVO.java    License: Apache License 2.0 6 votes vote down vote up
@Override
public String toString() {
    return MoreObjects.toStringHelper(this)
            .add("id", id)
            .add("name", name)
            .add("icon", icon)
            .add("description", description)
            .add("organizationId", organizationId)
            .add("colour", colour)
            .add("typeCode", typeCode)
            .add("initialize", initialize)
            .add("objectVersionNumber", objectVersionNumber)
            .add("stateMachineName", stateMachineName)
            .add("stateMachineId", stateMachineId)
            .toString();
}
 
Example #2
Source Project: celerio-angular-quickstart   Author: jaxio   File: Book.java    License: Apache License 2.0 6 votes vote down vote up
/**
 * Construct a readable string representation for this Book instance.
 * @see java.lang.Object#toString()
 */
@Override
public String toString() {
    return MoreObjects.toStringHelper(this) //
            .add("id", getId()) //
            .add("title", getTitle()) //
            .add("summary", getSummary()) //
            .add("extractBinary", getExtractBinary()) //
            .add("extractFileName", getExtractFileName()) //
            .add("extractContentType", getExtractContentType()) //
            .add("extractSize", getExtractSize()) //
            .add("publicationDate", getPublicationDate()) //
            .add("bestSeller", getBestSeller()) //
            .add("price", getPrice()) //
            .toString();
}
 
Example #3
Source Project: armeria   Author: line   File: ClientFactoryBuilder.java    License: Apache License 2.0 6 votes vote down vote up
@Override
public String toString() {
    final ToStringHelper helper = MoreObjects.toStringHelper(this).omitNullValues();
    helper.add("options", options);

    if (maxNumEventLoopsPerHttp1Endpoint > 0) {
        helper.add("maxNumEventLoopsPerHttp1Endpoint", maxNumEventLoopsPerHttp1Endpoint);
    }
    if (maxNumEventLoopsPerEndpoint > 0) {
        helper.add("maxNumEventLoopsPerEndpoint", maxNumEventLoopsPerEndpoint);
    }
    if (!maxNumEventLoopsFunctions.isEmpty()) {
        helper.add("maxNumEventLoopsFunctions", maxNumEventLoopsFunctions);
    }

    return helper.toString();
}
 
Example #4
Source Project: armeria   Author: line   File: DefaultCookie.java    License: Apache License 2.0 6 votes vote down vote up
@Override
public String toString() {
    final ToStringHelper helper = MoreObjects.toStringHelper(this).omitNullValues()
                                             .add("name", name)
                                             .add("value", !value.isEmpty() ? value : "<EMPTY>")
                                             .add("valueQuoted", valueQuoted)
                                             .add("domain", domain)
                                             .add("path", path);

    if (maxAge != Cookie.UNDEFINED_MAX_AGE) {
        helper.add("maxAge", maxAge);
    }

    if (secure) {
        helper.addValue("secure");
    }

    if (httpOnly) {
        helper.addValue("httpOnly");
    }

    helper.add("sameSite", sameSite);
    return helper.toString();
}
 
Example #5
Source Project: keywhiz   Author: square   File: Client.java    License: Apache License 2.0 6 votes vote down vote up
@Override
public String toString() {
  return MoreObjects.toStringHelper(this)
      .add("id", id)
      .add("name", name)
      .add("description", description)
      .add("spiffeId", spiffeId)
      .add("createdAt", createdAt)
      .add("createdBy", createdBy)
      .add("updatedAt", updatedAt)
      .add("updatedBy", updatedBy)
      .add("lastSeen", lastSeen)
      .add("expiration", expiration)
      .add("enabled", enabled)
      .add("automationAllowed", automationAllowed)
      .toString();
}
 
Example #6
Source Project: nakadi   Author: zalando   File: ArraySchemaDiff.java    License: MIT License 6 votes vote down vote up
private static void compareItemSchemaArray(
        final ArraySchema original, final ArraySchema update, final SchemaDiffState state) {
    final List<Schema> emptyList = ImmutableList.of();
    final List<Schema> originalSchemas = MoreObjects.firstNonNull(original.getItemSchemas(), emptyList);
    final List<Schema> updateSchemas = MoreObjects.firstNonNull(update.getItemSchemas(), emptyList);

    if (originalSchemas.size() != updateSchemas.size()) {
        state.addChange(NUMBER_OF_ITEMS_CHANGED);
    } else {
        final Iterator<Schema> originalIterator = originalSchemas.iterator();
        final Iterator<Schema> updateIterator = updateSchemas.iterator();
        int index = 0;
        while (originalIterator.hasNext()) {
            state.runOnPath("items/" + index, () -> {
                SchemaDiff.recursiveCheck(originalIterator.next(), updateIterator.next(), state);
            });
            index += 1;
        }
    }
}
 
Example #7
Source Project: Gatekeeper   Author: FINRAOS   File: UserTest.java    License: Apache License 2.0 6 votes vote down vote up
@Test
public void testToString(){
    String userId = "dudes";
    String userName = "The Dude";
    String userEmail = "[email protected]";

    User user = new User()
            .setId(1L)
            .setUserId(userId)
            .setName(userName)
            .setEmail(userEmail);


    String exp =  MoreObjects.toStringHelper(User.class)
            .add("ID", 1L)
            .add("User ID", userId)
            .add("Name", userName)
            .add("Email", userEmail)
            .toString();

    Assert.assertEquals("Testing toString()", exp, user.toString());

}
 
Example #8
Source Project: metasfresh-webui-api-legacy   Author: metasfresh   File: DocumentField.java    License: GNU General Public License v3.0 6 votes vote down vote up
@Override
public String toString()
{
	// NOTE: try keeping this string short...

	final String tableName = getDocument().getEntityDescriptor().getTableNameOrNull();
	final String fieldName = getFieldName();
	final String fieldNameFQ = tableName == null ? fieldName : tableName + "." + fieldName;
	return MoreObjects.toStringHelper(this)
			.add("fieldName", fieldNameFQ)
			// .add("documentPath", getDocumentPath())
			.add("value", _value)
			.add("initalValue", _initialValue)
			// .add("mandatory", _mandatory)
			// .add("readonly", _readonly)
			// .add("displayed", _displayed)
			.toString();
}
 
Example #9
Source Project: james-project   Author: apache   File: FakeMail.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public String toString() {
    return MoreObjects.toStringHelper(this)
        .add("msg", msg)
        .add("recipients", recipients)
        .add("name", name)
        .add("sender", sender)
        .add("state", state)
        .add("errorMessage", errorMessage)
        .add("lastUpdated", lastUpdated)
        .add("attributes", attributes)
        .add("size", size)
        .add("remoteAddr", remoteAddr)
        .toString();
}
 
Example #10
Source Project: metasfresh-webui-api-legacy   Author: metasfresh   File: DocumentLayoutSingleRow.java    License: GNU General Public License v3.0 5 votes vote down vote up
@Override
public String toString()
{
	return MoreObjects.toStringHelper(this)
			.add("caption", caption)
			.add("sections-count", sectionBuilders.size())
			.toString();
}
 
Example #11
Source Project: metasfresh-webui-api-legacy   Author: metasfresh   File: InvoiceRow.java    License: GNU General Public License v3.0 5 votes vote down vote up
@Override
public String toString()
{
	return MoreObjects.toStringHelper(this)
			.addValue(values.get(this))
			.toString();
}
 
Example #12
Source Project: james-project   Author: apache   File: MessageAttachmentMetadata.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public String toString() {
    return MoreObjects
            .toStringHelper(this)
            .add("attachment", attachment)
            .add("name", name)
            .add("cid", cid)
            .add("isInline", isInline)
            .toString();
}
 
Example #13
Source Project: Elasticsearch   Author: baidu   File: Assignment.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public String toString() {
    return MoreObjects.toStringHelper(this)
            .add("column", columnName)
            .add("expression", expression)
            .toString();
}
 
Example #14
Source Project: java-n-IDE-for-Android   Author: shenghuntianlang   File: CodeProjectSample.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public String toString() {
    return MoreObjects.toStringHelper(this)
            .add("name", name)
            .add("path", path)
            .add("description", description)
            .add("content", content)
            .add("query", query)
            .toString();
}
 
Example #15
Source Project: Gatekeeper   Author: FINRAOS   File: AWSInstance.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public String toString(){
    return MoreObjects.toStringHelper(this)
            .add("ID", id)
            .add("Instance Application", application)
            .add("Instance Name", name)
            .add("Instance ID", instanceId)
            .add("Instance IP", ip)
            .add("Status", status)
            .add("Platform", platform)
            .toString();
}
 
Example #16
Source Project: metasfresh-webui-api-legacy   Author: metasfresh   File: JSONDocumentAction.java    License: GNU General Public License v3.0 5 votes vote down vote up
@Override
public String toString()
{
	return MoreObjects.toStringHelper(this)
			.add("caption", caption)
			.add("processId", processId)
			.add("quickAction", quickAction)
			.add("defaultQuickAction", defaultQuickAction)
			.toString();
}
 
Example #17
Source Project: metasfresh-webui-api-legacy   Author: metasfresh   File: MenuTree.java    License: GNU General Public License v3.0 5 votes vote down vote up
@Override
public String toString()
{
	return MoreObjects.toStringHelper(this)
			.add("rootNode", rootNode)
			.add("version", version)
			.toString();
}
 
Example #18
Source Project: besu   Author: hyperledger   File: MetricsConfiguration.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public String toString() {
  return MoreObjects.toStringHelper(this)
      .add("enabled", enabled)
      .add("port", port)
      .add("host", host)
      .add("metricCategories", metricCategories)
      .add("pushEnabled", pushEnabled)
      .add("pushPort", pushPort)
      .add("pushHost", pushHost)
      .add("pushInterval", pushInterval)
      .add("prometheusJob", prometheusJob)
      .add("hostsAllowlist", hostsAllowlist)
      .toString();
}
 
Example #19
Source Project: Elasticsearch   Author: baidu   File: ShowTables.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public String toString() {
    return MoreObjects.toStringHelper(this)
            .add("schema", schema)
            .add("likePattern", likePattern.toString())
            .add("whereExpression", whereExpression.toString())
            .toString();
}
 
Example #20
Source Project: dhis2-core   Author: dhis2   File: AbstractNode.java    License: BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
@Override
public String toString()
{
    return MoreObjects.toStringHelper( this )
        .add( "name", name )
        .add( "nodeType", nodeType )
        .add( "parent", (parent != null ? parent.getName() : null) )
        .add( "namespace", namespace )
        .add( "comment", comment )
        .add( "children", children )
        .toString();
}
 
Example #21
Source Project: Gatekeeper   Author: FINRAOS   File: GatekeeperSearchUserEntry.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public String toString() {
    return MoreObjects.toStringHelper(this)
            .add("userId", userId)
            .add("email", email)
            .add("name", name)
            .toString();
}
 
Example #22
Source Project: grpc-nebula-java   Author: grpc-nebula   File: RetryPolicy.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public String toString() {
  return MoreObjects.toStringHelper(this)
      .add("maxAttempts", maxAttempts)
      .add("initialBackoffNanos", initialBackoffNanos)
      .add("maxBackoffNanos", maxBackoffNanos)
      .add("backoffMultiplier", backoffMultiplier)
      .add("retryableStatusCodes", retryableStatusCodes)
      .toString();
}
 
Example #23
Source Project: Elasticsearch   Author: baidu   File: ExplainType.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public String toString()
{
    return MoreObjects.toStringHelper(this)
            .add("type", type)
            .toString();
}
 
Example #24
Source Project: metasfresh-webui-api-legacy   Author: metasfresh   File: UserDashboard.java    License: GNU General Public License v3.0 5 votes vote down vote up
@Override
public String toString()
{
	return MoreObjects.toStringHelper(this)
			.omitNullValues()
			.add("id", id)
			.add("targetIndicatorItems", _targetIndicatorItemsById.isEmpty() ? null : _targetIndicatorItemsById)
			.add("kpiItemsById", _kpiItemsById.isEmpty() ? null : _kpiItemsById)
			.toString();
}
 
Example #25
Source Project: armeria   Author: line   File: HttpDataFile.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public String toString() {
    return MoreObjects.toStringHelper(this).omitNullValues()
                      .add("content", content())
                      .add("contentType", contentType())
                      .add("lastModified", DateFormatter.format(new Date(attrs.lastModifiedMillis())))
                      .add("dateEnabled", isDateEnabled())
                      .add("lastModifiedEnabled", isLastModifiedEnabled())
                      .add("headers", headers())
                      .toString();
}
 
Example #26
Source Project: grpc-nebula-java   Author: grpc-nebula   File: Status.java    License: Apache License 2.0 5 votes vote down vote up
/** A string representation of the status useful for debugging. */
@Override
public String toString() {
  return MoreObjects.toStringHelper(this)
      .add("code", code.name())
      .add("description", description)
      .add("cause", cause != null ? getStackTraceAsString(cause) : cause)
      .toString();
}
 
Example #27
Source Project: centraldogma   Author: line   File: CommitMessageDto.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public String toString() {
    final ToStringHelper stringHelper = MoreObjects.toStringHelper(this)
                                                   .add("summary", summary());
    if (!isNullOrEmpty(detail)) {
        stringHelper.add("detail", detail());
        stringHelper.add("markup", markup());
    }
    return stringHelper.toString();
}
 
Example #28
Source Project: aws-athena-query-federation   Author: awslabs   File: ThrottlingInvoker.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public String toString()
{
    return MoreObjects.toStringHelper(this)
            .add("initialDelayMs", initialDelayMs)
            .add("maxDelayMs", maxDelayMs)
            .add("decrease", decrease)
            .add("increase", increase)
            .add("delay", delay)
            .add("state", state)
            .toString();
}
 
Example #29
Source Project: dhis2-core   Author: dhis2   File: ImportSummaries.java    License: BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
public String toMinimalString()
{
    return MoreObjects.toStringHelper( this )
        .add( "imported", imported )
        .add( "updated", updated )
        .add( "deleted", deleted )
        .add( "ignored", ignored ).toString();
}
 
Example #30
Source Project: meghanada-server   Author: mopemope   File: Reference.java    License: GNU General Public License v3.0 5 votes vote down vote up
@Override
public String toString() {
  return MoreObjects.toStringHelper(this)
      .add("path", path)
      .add("line", line)
      .add("column", column)
      .add("code", code)
      .toString();
}