Search in sources :

Example 1 with ToStringBuilder

use of org.apache.commons.lang3.builder.ToStringBuilder in project cas by apereo.

the class CasCoreAuditConfiguration method nullableReturnValueResourceResolver.

@Bean
public AuditResourceResolver nullableReturnValueResourceResolver() {
    return new AuditResourceResolver() {

        @Override
        public String[] resolveFrom(final JoinPoint joinPoint, final Object o) {
            if (o == null) {
                return new String[0];
            }
            if (o instanceof Event) {
                final Event event = Event.class.cast(o);
                final String sourceName = event.getSource().getClass().getSimpleName();
                final String result = new ToStringBuilder(event, ToStringStyle.NO_CLASS_NAME_STYLE).append("event", event.getId()).append("timestamp", new Date(event.getTimestamp())).append("source", sourceName).toString();
                return new String[] { result };
            }
            return returnValueResourceResolver().resolveFrom(joinPoint, o);
        }

        @Override
        public String[] resolveFrom(final JoinPoint joinPoint, final Exception e) {
            return returnValueResourceResolver().resolveFrom(joinPoint, e);
        }
    };
}
Also used : ToStringBuilder(org.apache.commons.lang3.builder.ToStringBuilder) AuditResourceResolver(org.apereo.inspektr.audit.spi.AuditResourceResolver) Event(org.springframework.webflow.execution.Event) Date(java.util.Date) JoinPoint(org.aspectj.lang.JoinPoint) FilterRegistrationBean(org.springframework.boot.web.servlet.FilterRegistrationBean) ConditionalOnMissingBean(org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean) Bean(org.springframework.context.annotation.Bean)

Example 2 with ToStringBuilder

use of org.apache.commons.lang3.builder.ToStringBuilder in project cas by apereo.

the class AbstractRegisteredService method toString.

@Override
public String toString() {
    final ToStringBuilder toStringBuilder = new ToStringBuilder(null, ToStringStyle.SHORT_PREFIX_STYLE);
    toStringBuilder.append("id", this.id);
    toStringBuilder.append("name", this.name);
    toStringBuilder.append("description", this.description);
    toStringBuilder.append("serviceId", this.serviceId);
    toStringBuilder.append("usernameAttributeProvider", this.usernameAttributeProvider);
    toStringBuilder.append("theme", this.theme);
    toStringBuilder.append("evaluationOrder", this.evaluationOrder);
    toStringBuilder.append("logoutType", this.logoutType);
    toStringBuilder.append("attributeReleasePolicy", this.attributeReleasePolicy);
    toStringBuilder.append("accessStrategy", this.accessStrategy);
    toStringBuilder.append("publicKey", this.publicKey);
    toStringBuilder.append("proxyPolicy", this.proxyPolicy);
    toStringBuilder.append("logo", this.logo);
    toStringBuilder.append("logoutUrl", this.logoutUrl);
    toStringBuilder.append("requiredHandlers", this.requiredHandlers);
    toStringBuilder.append("properties", this.properties);
    toStringBuilder.append("multifactorPolicy", this.multifactorPolicy);
    toStringBuilder.append("informationUrl", this.informationUrl);
    toStringBuilder.append("privacyUrl", this.privacyUrl);
    return toStringBuilder.toString();
}
Also used : ToStringBuilder(org.apache.commons.lang3.builder.ToStringBuilder)

Example 3 with ToStringBuilder

use of org.apache.commons.lang3.builder.ToStringBuilder in project pinot by linkedin.

the class Cube method toString.

@Override
public String toString() {
    ToStringBuilder tsb = new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE);
    tsb.append("Baseline Value", topBaselineValue).append("Current Value", topCurrentValue).append("Ratio", topRatio).append("Dimentions", this.dimensions).append("#Detailed Rows", hierarchicalRows.get(hierarchicalRows.size() - 1).size());
    return tsb.toString();
}
Also used : ToStringBuilder(org.apache.commons.lang3.builder.ToStringBuilder)

Example 4 with ToStringBuilder

use of org.apache.commons.lang3.builder.ToStringBuilder in project cas by apereo.

the class OAuthRegisteredService method toString.

@Override
public String toString() {
    final ToStringBuilder builder = new ToStringBuilder(this);
    builder.appendSuper(super.toString());
    builder.append("clientId", getClientId());
    builder.append("approvalPrompt", isBypassApprovalPrompt());
    builder.append("generateRefreshToken", isGenerateRefreshToken());
    builder.append("jsonFormat", isJsonFormat());
    return builder.toString();
}
Also used : ToStringBuilder(org.apache.commons.lang3.builder.ToStringBuilder)

Example 5 with ToStringBuilder

use of org.apache.commons.lang3.builder.ToStringBuilder in project nifi by apache.

the class StandardFlowFileRecord method toString.

@Override
public String toString() {
    final ToStringBuilder builder = new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE);
    builder.append("uuid", getAttribute(CoreAttributes.UUID.key()));
    builder.append("claim", claim == null ? "" : claim.toString());
    builder.append("offset", claimOffset);
    builder.append("name", getAttribute(CoreAttributes.FILENAME.key())).append("size", size);
    return builder.toString();
}
Also used : ToStringBuilder(org.apache.commons.lang3.builder.ToStringBuilder)

Aggregations

ToStringBuilder (org.apache.commons.lang3.builder.ToStringBuilder)98 Person (org.apache.commons.lang3.builder.ToStringStyleTest.Person)10 Test (org.junit.Test)10 XWikiToStringBuilder (org.xwiki.text.XWikiToStringBuilder)7 Date (java.util.Date)3 Map (java.util.Map)3 HashMap (java.util.HashMap)2 HashSet (java.util.HashSet)2 Optional (java.util.Optional)2 Set (java.util.Set)2 Slf4j (lombok.extern.slf4j.Slf4j)2 StringUtils (org.apache.commons.lang3.StringUtils)2 ToStringStyle (org.apache.commons.lang3.builder.ToStringStyle)2 Pair (org.apache.commons.lang3.tuple.Pair)2 Level (org.apache.logging.log4j.Level)2 LoggerContext (org.apache.logging.log4j.core.LoggerContext)2 FileAppender (org.apache.logging.log4j.core.appender.FileAppender)2 MemoryMappedFileAppender (org.apache.logging.log4j.core.appender.MemoryMappedFileAppender)2 RandomAccessFileAppender (org.apache.logging.log4j.core.appender.RandomAccessFileAppender)2 RollingFileAppender (org.apache.logging.log4j.core.appender.RollingFileAppender)2