com.google.common.base.MoreObjects Java Examples

The following examples show how to use com.google.common.base.MoreObjects. 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 File: IssueTypeVO.java    From agile-service-old with 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 File: Book.java    From celerio-angular-quickstart with 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 File: ArraySchemaDiff.java    From nakadi with 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 #4
Source File: UserTest.java    From Gatekeeper with 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 #5
Source File: Client.java    From keywhiz with 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 File: DefaultCookie.java    From armeria with 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 #7
Source File: ClientFactoryBuilder.java    From armeria with 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 #8
Source File: DocumentField.java    From metasfresh-webui-api-legacy with 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 File: User.java    From centraldogma with Apache License 2.0 5 votes vote down vote up
@Override
public String toString() {
    return MoreObjects.toStringHelper(this)
                      .add("login", login())
                      .add("name", name())
                      .add("email", email())
                      .add("roles", roles())
                      .add("isAdmin", isAdmin())
                      .toString();
}
 
Example #10
Source File: ApiKey.java    From endpoints-java with Apache License 2.0 5 votes vote down vote up
@Override
public String toString() {
  return MoreObjects.toStringHelper(this)
      .add("name", name)
      .add("version", version)
      .add("root", root)
      .toString();
}
 
Example #11
Source File: GenericServiceOperator.java    From arctic-sea with Apache License 2.0 5 votes vote down vote up
@Override
public String toString() {
    return MoreObjects.toStringHelper(this)
            .add("service", this.service)
            .add("version", this.version)
            .toString();
}
 
Example #12
Source File: DocumentFieldDependencyMap.java    From metasfresh-webui-api-legacy with GNU General Public License v3.0 5 votes vote down vote up
@Override
public String toString()
{
	return MoreObjects.toStringHelper(this)
			.addValue(type2name2dependencies)
			.toString();
}
 
Example #13
Source File: AbstractBrooklynObjectSpec.java    From brooklyn-server with Apache License 2.0 5 votes vote down vote up
@Override
public String toString() {
    return MoreObjects.toStringHelper(this).omitNullValues()
            .add("type", type)
            .add("displayName", displayName)
            .toString();
}
 
Example #14
Source File: ProviderInstanceBindingImpl.java    From businessworks with Apache License 2.0 5 votes vote down vote up
@Override
public String toString() {
  return MoreObjects.toStringHelper(ProviderInstanceBinding.class)
      .add("key", getKey())
      .add("source", getSource())
      .add("scope", getScoping())
      .add("provider", providerInstance)
      .toString();
}
 
Example #15
Source File: DocumentLayoutDetailDescriptor.java    From metasfresh-webui-api-legacy with GNU General Public License v3.0 5 votes vote down vote up
@Override
public String toString()
{
	return MoreObjects.toStringHelper(this)
			.add("detailId", detailId)
			.toString();
}
 
Example #16
Source File: RecordingSshTool.java    From brooklyn-server with Apache License 2.0 5 votes vote down vote up
@Override
public String toString() {
    return MoreObjects.toStringHelper(this)
            .add("constructorProps", constructorProps)
            .add("props", props)
            .add("commands", commands)
            .add("env", env).toString();
}
 
Example #17
Source File: CommitMessageDto.java    From centraldogma with 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 #18
Source File: ServiceConfigInterceptor.java    From grpc-nebula-java with Apache License 2.0 5 votes vote down vote up
@Override
public String toString() {
  return MoreObjects.toStringHelper(this)
      .add("timeoutNanos", timeoutNanos)
      .add("waitForReady", waitForReady)
      .add("maxInboundMessageSize", maxInboundMessageSize)
      .add("maxOutboundMessageSize", maxOutboundMessageSize)
      .add("retryPolicy", retryPolicy)
      .toString();
}
 
Example #19
Source File: ViewAsPreconditionsContext.java    From metasfresh-webui-api-legacy with GNU General Public License v3.0 5 votes vote down vote up
@Override
public String toString()
{
	return MoreObjects.toStringHelper(this)
			.omitNullValues()
			.add("modelClass", modelClass)
			.add("models", models)
			.toString();
}
 
Example #20
Source File: TaskInternal.java    From brooklyn-server with Apache License 2.0 5 votes vote down vote up
@Override
public String toString() {
    return MoreObjects.toStringHelper(this).add("interruptTask", allowedToInterruptTask)
        .add("interruptDependentSubmitted", allowedToInterruptDependentSubmittedTasks)
        .add("interruptAllSubmitted", allowedToInterruptAllSubmittedTasks)
        .toString();
}
 
Example #21
Source File: CompostIndexEntry.java    From termsuite-core with Apache License 2.0 5 votes vote down vote up
@Override
public String toString() {
	return MoreObjects.toStringHelper(this)
			.add("text", this.text)
			.addValue(this.inDico)
			.addValue(this.inCorpus)
			.addValue(this.isInNeoClassicalPrefix())
			.toString()
			;
}
 
Example #22
Source File: WebMessage.java    From dhis2-core with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
@Override
public String toString()
{
    return MoreObjects.toStringHelper( this )
        .add( "status", status )
        .add( "code", code )
        .add( "httpStatus", httpStatus )
        .add( "message", message )
        .add( "devMessage", devMessage )
        .add( "response", response )
        .toString();
}
 
Example #23
Source File: WebSocketConfiguration.java    From besu with 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("rpcApis", rpcApis)
      .add("authenticationEnabled", authenticationEnabled)
      .add("authenticationCredentialsFile", authenticationCredentialsFile)
      .add("hostsAllowlist", hostsAllowlist)
      .add("authenticationPublicKeyFile", authenticationPublicKeyFile)
      .add("timeoutSec", timeoutSec)
      .toString();
}
 
Example #24
Source File: WatchRequestConverter.java    From centraldogma with Apache License 2.0 5 votes vote down vote up
@Override
public String toString() {
    return MoreObjects.toStringHelper(this)
                      .add("lastKnownRevision", lastKnownRevision)
                      .add("timeoutMillis", timeoutMillis)
                      .toString();
}
 
Example #25
Source File: OrganisationUnitQueryParams.java    From dhis2-core with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
@Override
public String toString()
{
    return MoreObjects.toStringHelper( this ).
        add( "query", query ).
        add( "parents", parents ).
        add( "groups", groups ).
        add( "levels", levels ).
        add( "maxLevels", maxLevels ).
        add( "first", first ).
        add( "max", max ).toString();
}
 
Example #26
Source File: CreateTenant.java    From Elasticsearch with Apache License 2.0 5 votes vote down vote up
@Override
public String toString()
{
    return MoreObjects.toStringHelper(this)
            .add("name", tenantName)
            .add("properties", properties).toString();
}
 
Example #27
Source File: DiffUtil.java    From copybara with Apache License 2.0 5 votes vote down vote up
@Override
public String toString() {
  return MoreObjects.toStringHelper(this)
      .add("name", name)
      .add("operation", operation)
      .toString();
}
 
Example #28
Source File: Reference.java    From meghanada-server with 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();
}
 
Example #29
Source File: ImportSummaries.java    From dhis2-core with 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 File: ThrottlingInvoker.java    From aws-athena-query-federation with 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();
}