org.springframework.core.style.ToStringCreator Java Examples

The following examples show how to use org.springframework.core.style.ToStringCreator. 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: PrintingResultHandler.java    From spring-analysis-note with MIT License 6 votes vote down vote up
/**
 * Print the supplied cookies in a human-readable form, assuming the
 * {@link Cookie} implementation does not provide its own {@code toString()}.
 * @since 4.2
 */
private void printCookies(Cookie[] cookies) {
	String[] cookieStrings = new String[cookies.length];
	for (int i = 0; i < cookies.length; i++) {
		Cookie cookie = cookies[i];
		cookieStrings[i] = new ToStringCreator(cookie)
			.append("name", cookie.getName())
			.append("value", cookie.getValue())
			.append("comment", cookie.getComment())
			.append("domain", cookie.getDomain())
			.append("maxAge", cookie.getMaxAge())
			.append("path", cookie.getPath())
			.append("secure", cookie.getSecure())
			.append("version", cookie.getVersion())
			.append("httpOnly", cookie.isHttpOnly())
			.toString();
	}
	this.printer.printValue("Cookies", cookieStrings);
}
 
Example #2
Source File: PrintingResultHandler.java    From java-technology-stack with MIT License 6 votes vote down vote up
/**
 * Print the supplied cookies in a human-readable form, assuming the
 * {@link Cookie} implementation does not provide its own {@code toString()}.
 * @since 4.2
 */
private void printCookies(Cookie[] cookies) {
	String[] cookieStrings = new String[cookies.length];
	for (int i = 0; i < cookies.length; i++) {
		Cookie cookie = cookies[i];
		cookieStrings[i] = new ToStringCreator(cookie)
			.append("name", cookie.getName())
			.append("value", cookie.getValue())
			.append("comment", cookie.getComment())
			.append("domain", cookie.getDomain())
			.append("maxAge", cookie.getMaxAge())
			.append("path", cookie.getPath())
			.append("secure", cookie.getSecure())
			.append("version", cookie.getVersion())
			.append("httpOnly", cookie.isHttpOnly())
			.toString();
	}
	this.printer.printValue("Cookies", cookieStrings);
}
 
Example #3
Source File: HttpClientProperties.java    From spring-cloud-gateway with Apache License 2.0 6 votes vote down vote up
@Override
public String toString() {
	// @formatter:off
	return new ToStringCreator(this)
			.append("connectTimeout", connectTimeout)
			.append("responseTimeout", responseTimeout)
			.append("maxHeaderSize", maxHeaderSize)
			.append("maxInitialLineLength", maxInitialLineLength)
			.append("pool", pool)
			.append("proxy", proxy)
			.append("ssl", ssl)
			.append("websocket", websocket)
			.append("wiretap", wiretap)
			.toString();
	// @formatter:on

}
 
Example #4
Source File: MergedContextConfiguration.java    From spring-analysis-note with MIT License 6 votes vote down vote up
/**
 * Provide a String representation of the {@linkplain #getTestClass() test class},
 * {@linkplain #getLocations() locations}, {@linkplain #getClasses() annotated classes},
 * {@linkplain #getContextInitializerClasses() context initializer classes},
 * {@linkplain #getActiveProfiles() active profiles},
 * {@linkplain #getPropertySourceLocations() property source locations},
 * {@linkplain #getPropertySourceProperties() property source properties},
 * {@linkplain #getContextCustomizers() context customizers},
 * the name of the {@link #getContextLoader() ContextLoader}, and the
 * {@linkplain #getParent() parent configuration}.
 */
@Override
public String toString() {
	return new ToStringCreator(this)
			.append("testClass", this.testClass)
			.append("locations", ObjectUtils.nullSafeToString(this.locations))
			.append("classes", ObjectUtils.nullSafeToString(this.classes))
			.append("contextInitializerClasses", ObjectUtils.nullSafeToString(this.contextInitializerClasses))
			.append("activeProfiles", ObjectUtils.nullSafeToString(this.activeProfiles))
			.append("propertySourceLocations", ObjectUtils.nullSafeToString(this.propertySourceLocations))
			.append("propertySourceProperties", ObjectUtils.nullSafeToString(this.propertySourceProperties))
			.append("contextCustomizers", this.contextCustomizers)
			.append("contextLoader", nullSafeClassName(this.contextLoader))
			.append("parent", this.parent)
			.toString();
}
 
Example #5
Source File: WebMergedContextConfiguration.java    From spring4-understanding with Apache License 2.0 6 votes vote down vote up
/**
 * Provide a String representation of the {@linkplain #getTestClass() test class},
 * {@linkplain #getLocations() locations}, {@linkplain #getClasses() annotated classes},
 * {@linkplain #getContextInitializerClasses() context initializer classes},
 * {@linkplain #getActiveProfiles() active profiles},
 * {@linkplain #getPropertySourceLocations() property source locations},
 * {@linkplain #getPropertySourceProperties() property source properties},
 * {@linkplain #getResourceBasePath() resource base path}, the name of the
 * {@link #getContextLoader() ContextLoader}, and the
 * {@linkplain #getParent() parent configuration}.
 */
@Override
public String toString() {
	return new ToStringCreator(this)
			.append("testClass", getTestClass())
			.append("locations", ObjectUtils.nullSafeToString(getLocations()))
			.append("classes", ObjectUtils.nullSafeToString(getClasses()))
			.append("contextInitializerClasses", ObjectUtils.nullSafeToString(getContextInitializerClasses()))
			.append("activeProfiles", ObjectUtils.nullSafeToString(getActiveProfiles()))
			.append("propertySourceLocations", ObjectUtils.nullSafeToString(getPropertySourceLocations()))
			.append("propertySourceProperties", ObjectUtils.nullSafeToString(getPropertySourceProperties()))
			.append("resourceBasePath", getResourceBasePath())
			.append("contextLoader", nullSafeToString(getContextLoader()))
			.append("parent", getParent())
			.toString();
}
 
Example #6
Source File: PrintingResultHandler.java    From spring4-understanding with Apache License 2.0 6 votes vote down vote up
/**
 * Print the supplied cookies in a human-readable form, assuming the
 * {@link Cookie} implementation does not provide its own {@code toString()}.
 * @since 4.2
 */
private void printCookies(Cookie[] cookies) {
	String[] cookieStrings = new String[cookies.length];
	for (int i = 0; i < cookies.length; i++) {
		Cookie cookie = cookies[i];
		cookieStrings[i] = new ToStringCreator(cookie)
			.append("name", cookie.getName())
			.append("value", cookie.getValue())
			.append("comment", cookie.getComment())
			.append("domain", cookie.getDomain())
			.append("maxAge", cookie.getMaxAge())
			.append("path", cookie.getPath())
			.append("secure", cookie.getSecure())
			.append("version", cookie.getVersion())
			.append("httpOnly", cookie.isHttpOnly())
			.toString();
	}
	this.printer.printValue("Cookies", cookieStrings);
}
 
Example #7
Source File: Owner.java    From amazon-ecs-java-microservices with Apache License 2.0 5 votes vote down vote up
@Override
public String toString() {
    return new ToStringCreator(this)

        .append("id", this.getId())
        .append("new", this.isNew())
        .append("lastName", this.getLastName())
        .append("firstName", this.getFirstName())
        .append("address", this.address)
        .append("city", this.city)
        .append("telephone", this.telephone)
        .toString();
}
 
Example #8
Source File: Owner.java    From amazon-ecs-java-microservices with Apache License 2.0 5 votes vote down vote up
@Override
public String toString() {
    return new ToStringCreator(this)

        .append("id", this.getId())
        .append("new", this.isNew())
        .append("lastName", this.getLastName())
        .append("firstName", this.getFirstName())
        .append("address", this.address)
        .append("city", this.city)
        .append("telephone", this.telephone)
        .toString();
}
 
Example #9
Source File: Owner.java    From amazon-ecs-java-microservices with Apache License 2.0 5 votes vote down vote up
@Override
public String toString() {
    return new ToStringCreator(this)

        .append("id", this.getId())
        .append("new", this.isNew())
        .append("lastName", this.getLastName())
        .append("firstName", this.getFirstName())
        .append("address", this.address)
        .append("city", this.city)
        .append("telephone", this.telephone)
        .toString();
}
 
Example #10
Source File: Owner.java    From amazon-ecs-java-microservices with Apache License 2.0 5 votes vote down vote up
@Override
public String toString() {
    return new ToStringCreator(this)

        .append("id", this.getId())
        .append("new", this.isNew())
        .append("lastName", this.getLastName())
        .append("firstName", this.getFirstName())
        .append("address", this.address)
        .append("city", this.city)
        .append("telephone", this.telephone)
        .toString();
}
 
Example #11
Source File: CompletionContext.java    From spring-cloud-commons with Apache License 2.0 5 votes vote down vote up
@Override
public String toString() {
	ToStringCreator to = new ToStringCreator(this);
	to.append("status", this.status);
	to.append("throwable", this.throwable);
	return to.toString();
}
 
Example #12
Source File: Owner.java    From amazon-ecs-java-microservices with Apache License 2.0 5 votes vote down vote up
@Override
public String toString() {
    return new ToStringCreator(this)

        .append("id", this.getId())
        .append("new", this.isNew())
        .append("lastName", this.getLastName())
        .append("firstName", this.getFirstName())
        .append("address", this.address)
        .append("city", this.city)
        .append("telephone", this.telephone)
        .toString();
}
 
Example #13
Source File: Owner.java    From amazon-ecs-java-microservices with Apache License 2.0 5 votes vote down vote up
@Override
public String toString() {
    return new ToStringCreator(this)

        .append("id", this.getId())
        .append("new", this.isNew())
        .append("lastName", this.getLastName())
        .append("firstName", this.getFirstName())
        .append("address", this.address)
        .append("city", this.city)
        .append("telephone", this.telephone)
        .toString();
}
 
Example #14
Source File: DefaultContextCache.java    From spring4-understanding with Apache License 2.0 5 votes vote down vote up
/**
 * Generate a text string containing the implementation type of this
 * cache and its statistics.
 * <p>The string returned by this method contains all information
 * required for compliance with the contract for {@link #logStatistics()}.
 * @return a string representation of this cache, including statistics
 */
@Override
public String toString() {
	return new ToStringCreator(this)
			.append("size", size())
			.append("parentContextCount", getParentContextCount())
			.append("hitCount", getHitCount())
			.append("missCount", getMissCount())
			.toString();
}
 
Example #15
Source File: Bean1.java    From snake-yaml with Apache License 2.0 5 votes vote down vote up
@Override
public String toString() {
    ToStringCreator builder = new ToStringCreator(this);
    builder.append(this.strVal);
    builder.append(this.intVal);
    return builder.toString();
}
 
Example #16
Source File: UnknownRemoteApplicationEvent.java    From spring-cloud-bus with Apache License 2.0 5 votes vote down vote up
@Override
public String toString() {
	return new ToStringCreator(this).append("id", getId())
			.append("originService", getOriginService())
			.append("destinationService", getDestinationService())
			.append("typeInfo", typeInfo).append("payload", getPayloadAsString())
			.toString();

}
 
Example #17
Source File: Owner.java    From amazon-ecs-java-microservices with Apache License 2.0 5 votes vote down vote up
@Override
public String toString() {
    return new ToStringCreator(this)

        .append("id", this.getId())
        .append("new", this.isNew())
        .append("lastName", this.getLastName())
        .append("firstName", this.getFirstName())
        .append("address", this.address)
        .append("city", this.city)
        .append("telephone", this.telephone)
        .toString();
}
 
Example #18
Source File: Owner.java    From audit4j-demo with Apache License 2.0 5 votes vote down vote up
@Override
public String toString() {
    return new ToStringCreator(this)

            .append("id", this.getId())
            .append("new", this.isNew())
            .append("lastName", this.getLastName())
            .append("firstName", this.getFirstName())
            .append("address", this.address)
            .append("city", this.city)
            .append("telephone", this.telephone)
            .toString();
}
 
Example #19
Source File: ConsulEndpoint.java    From spring-cloud-consul with Apache License 2.0 5 votes vote down vote up
@Override
public String toString() {
	return new ToStringCreator(this)
			.append("catalogServices", this.catalogServices)
			.append("agentServices", this.agentServices)
			.append("catalogNodes", this.catalogNodes).toString();
}
 
Example #20
Source File: ConsulProperties.java    From spring-cloud-consul with Apache License 2.0 5 votes vote down vote up
@Override
public String toString() {
	return new ToStringCreator(this)
			.append("keyStoreInstanceType", this.keyStoreInstanceType)
			.append("keyStorePath", this.keyStorePath)
			.append("keyStorePassword", this.keyStorePassword)
			.append("certificatePath", this.certificatePath)
			.append("certificatePassword", this.certificatePassword).toString();
}
 
Example #21
Source File: Bindable.java    From spring-cloud-gray with Apache License 2.0 5 votes vote down vote up
@Override
public String toString() {
    ToStringCreator creator = new ToStringCreator(this);
    creator.append("type", this.type);
    creator.append("value", (this.value != null) ? "provided" : "none");
    creator.append("annotations", this.annotations);
    return creator.toString();
}
 
Example #22
Source File: MergedSqlConfig.java    From spring4-understanding with Apache License 2.0 5 votes vote down vote up
/**
 * Provide a String representation of the merged SQL script configuration.
 */
@Override
public String toString() {
	return new ToStringCreator(this)//
	.append("dataSource", dataSource)//
	.append("transactionManager", transactionManager)//
	.append("transactionMode", transactionMode)//
	.append("encoding", encoding)//
	.append("separator", separator)//
	.append("commentPrefix", commentPrefix)//
	.append("blockCommentStartDelimiter", blockCommentStartDelimiter)//
	.append("blockCommentEndDelimiter", blockCommentEndDelimiter)//
	.append("errorMode", errorMode)//
	.toString();
}
 
Example #23
Source File: OnComplete.java    From spring-cloud-loadbalancer with Apache License 2.0 5 votes vote down vote up
@Override
public String toString() {
	ToStringCreator to = new ToStringCreator(this);
	to.append("status", status);
	to.append("throwable", throwable);
	return to.toString();
}
 
Example #24
Source File: TestPropertySourceAttributes.java    From spring4-understanding with Apache License 2.0 5 votes vote down vote up
/**
 * Provide a String representation of the {@code @TestPropertySource}
 * attributes and declaring class.
 */
@Override
public String toString() {
	return new ToStringCreator(this)//
	.append("declaringClass", declaringClass.getName())//
	.append("locations", ObjectUtils.nullSafeToString(locations))//
	.append("inheritLocations", inheritLocations)//
	.append("properties", ObjectUtils.nullSafeToString(properties))//
	.append("inheritProperties", inheritProperties)//
	.toString();
}
 
Example #25
Source File: WeightCalculatorWebFilter.java    From spring-cloud-gateway with Apache License 2.0 5 votes vote down vote up
@Override
public String toString() {
	return new ToStringCreator(this).append("group", group)
			.append("weights", weights)
			.append("normalizedWeights", normalizedWeights)
			.append("rangeIndexes", rangeIndexes).toString();
}
 
Example #26
Source File: ClusterService.java    From spring-cloud-rsocket with Apache License 2.0 5 votes vote down vote up
@Override
public String toString() {
	// @formatter:off
	return new ToStringCreator(this)
			.append("brokerId", brokerId)
			.append("tags", tags)
			.append("timestamp", timestamp)
			.toString();
	// @formatter:on
}
 
Example #27
Source File: BrokerProperties.java    From spring-cloud-rsocket with Apache License 2.0 5 votes vote down vote up
@Override
public String toString() {
	// @formatter:off
	return new ToStringCreator(this)
			.append("enabled", enabled)
			.append("id", id)
			.append("micrometerTags", micrometerTags)
			.append("routeId", routeId)
			.append("serviceName", serviceName)
			.append("brokers", brokers)
			.toString();
	// @formatter:on
}
 
Example #28
Source File: Owner.java    From DevOps-for-Web-Development with MIT License 5 votes vote down vote up
@Override
public String toString() {
    return new ToStringCreator(this)

        .append("id", this.getId())
        .append("new", this.isNew())
        .append("lastName", this.getLastName())
        .append("firstName", this.getFirstName())
        .append("address", this.address)
        .append("city", this.city)
        .append("telephone", this.telephone)
        .toString();
}
 
Example #29
Source File: EnvironmentChangeRemoteApplicationEvent.java    From spring-cloud-bus with Apache License 2.0 5 votes vote down vote up
@Override
public String toString() {
	return new ToStringCreator(this).append("id", getId())
			.append("originService", getOriginService())
			.append("destinationService", getDestinationService())
			.append("values", values).toString();

}
 
Example #30
Source File: MergedContextConfiguration.java    From spring4-understanding with Apache License 2.0 5 votes vote down vote up
/**
 * Provide a String representation of the {@linkplain #getTestClass() test class},
 * {@linkplain #getLocations() locations}, {@linkplain #getClasses() annotated classes},
 * {@linkplain #getContextInitializerClasses() context initializer classes},
 * {@linkplain #getActiveProfiles() active profiles},
 * {@linkplain #getPropertySourceLocations() property source locations},
 * {@linkplain #getPropertySourceProperties() property source properties},
 * the name of the {@link #getContextLoader() ContextLoader}, and the
 * {@linkplain #getParent() parent configuration}.
 */
@Override
public String toString() {
	return new ToStringCreator(this)
			.append("testClass", this.testClass)
			.append("locations", ObjectUtils.nullSafeToString(this.locations))
			.append("classes", ObjectUtils.nullSafeToString(this.classes))
			.append("contextInitializerClasses", ObjectUtils.nullSafeToString(this.contextInitializerClasses))
			.append("activeProfiles", ObjectUtils.nullSafeToString(this.activeProfiles))
			.append("propertySourceLocations", ObjectUtils.nullSafeToString(this.propertySourceLocations))
			.append("propertySourceProperties", ObjectUtils.nullSafeToString(this.propertySourceProperties))
			.append("contextLoader", nullSafeToString(this.contextLoader))
			.append("parent", this.parent)
			.toString();
}