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

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

Introduction

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

Prototype

ToStringStyle SIMPLE_STYLE

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

Click Source Link

Document

The simple toString style.

Usage

From source file:com.github.dozermapper.core.vo.generics.parameterized.AbstractDto.java

/**
 * {@inheritDoc}
 */
@Override
public String toString() {
    return ToStringBuilder.reflectionToString(this, ToStringStyle.SIMPLE_STYLE);
}

From source file:com.evrythng.commons.domain.Value.java

@Override
public final String toString() {

    ToStringBuilder toString = new ToStringBuilder(this, ToStringStyle.SIMPLE_STYLE);
    toString.append("value", value);
    return toString.build();
}

From source file:com.flipkart.polyguice.core.support.SingletonKey.java

@Override
public String toString() {
    return ReflectionToStringBuilder.toString(this, ToStringStyle.SIMPLE_STYLE);
}

From source file:de.micromata.genome.util.types.Triple.java

@Override
public String toString() {
    final String result = new ToStringBuilder(this, ToStringStyle.SIMPLE_STYLE) //
            .append("1:", left) //
            .append("2:", middle) //
            .append("3:", right) //
            .toString();/*  w w  w .j  a v  a  2  s.co m*/
    return result;
}

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

@Override
public String toString() {
    ToStringBuilder b = new ToStringBuilder(this, ToStringStyle.SIMPLE_STYLE);
    b.append("prefix", getPrefix());
    b.append("value", myQuantity);
    return b.build();
}

From source file:io.resthelper.test.RestHelperServiceTest.java

@Test
public void test() throws IOException {
    Properties properties = new Properties();
    properties.load(this.getClass().getResourceAsStream("/resthelper.properties"));

    assertNotNull(properties);// w w  w  .  j  av a2  s .c o m
    String strBasePackages = properties.getProperty("resthelper.base.packages");
    assertNotNull(strBasePackages);

    String[] arrBasePackages = strBasePackages.split(",");

    String[] basePackages = restHelperService.getBasePackages();
    assertNotNull(basePackages);

    for (int i = 0; i < basePackages.length; i++) {
        assertTrue(basePackages[i].equals(arrBasePackages[i].trim()));
    }

    for (String basePackage : basePackages) {
        List<RestApi> apiList = restHelperService.getApiList(basePackage);

        logger.info("basePackage:{}", basePackage);
        for (RestApi restApi : apiList) {
            logger.info("\tapi:{}", ToStringBuilder.reflectionToString(restApi, ToStringStyle.SIMPLE_STYLE));
        }
    }
}

From source file:cherry.foundation.springmvc.OperationLogHandlerInterceptor.java

@Override
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) {

    Principal principal = request.getUserPrincipal();
    if (principal == null) {
        SecurityContext context = SecurityContextHolder.getContext();
        if (context != null) {
            principal = context.getAuthentication();
        }/*ww  w .j  a  v  a 2s.c  o  m*/
    }
    if (principal != null) {
        MDC.put(LOGIN_ID, principal.getName());
    }

    StringBuilder builder = createBasicInfo(request);

    builder.append(" {");
    boolean first = true;
    for (Map.Entry<String, String[]> entry : request.getParameterMap().entrySet()) {

        String key = entry.getKey();
        String lkey = key.toLowerCase();
        String[] val = entry.getValue();

        if (!first) {
            builder.append(", ");
        }
        first = false;
        builder.append(key).append(": ");
        if (lkey.contains("password")) {
            builder.append("<MASKED>");
        } else {
            builder.append(ToStringBuilder.reflectionToString(val, ToStringStyle.SIMPLE_STYLE));
        }

        for (int i = 0; i < paramPattern.size(); i++) {
            if (paramPattern.get(i).matcher(lkey).matches()) {
                if (val != null && val.length == 1) {
                    MDC.put(paramMdcKey.get(i), val[0]);
                } else {
                    MDC.put(paramMdcKey.get(i),
                            ToStringBuilder.reflectionToString(val, ToStringStyle.SIMPLE_STYLE));
                }
            }
        }
    }
    builder.append("}");

    loggerEnter.info(builder.toString());

    return true;
}

From source file:com.evrythng.thng.resource.model.store.Property.java

@Override
public String toString() {

    ToStringBuilder toString = new ToStringBuilder(this, ToStringStyle.SIMPLE_STYLE);
    toString.append("key", key);
    toString.append("value", value);
    toString.append("timestamp", getTimestamp());
    return toString.build();
}

From source file:com.norconex.collector.http.crawler.CrawlURL.java

@Override
public String toString() {
    return new ToStringBuilder(this, ToStringStyle.SIMPLE_STYLE).append("depth", depth).append("url", url)
            .append("urlRoot", urlRoot).append("sitemapLastMod", sitemapLastMod)
            .append("sitemapChangeFreq", sitemapChangeFreq).append("sitemapPriority", sitemapPriority)
            .append("status", status).append("headChecksum", headChecksum).append("docChecksum", docChecksum)
            .toString();//from   ww w .j av  a  2s  .  c o m
}

From source file:VOBackupFile.java

@Override
public String toString() {
    return ToStringBuilder.reflectionToString(this, ToStringStyle.SIMPLE_STYLE);
}