Example usage for org.apache.commons.lang3.builder StandardToStringStyle StandardToStringStyle

List of usage examples for org.apache.commons.lang3.builder StandardToStringStyle StandardToStringStyle

Introduction

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

Prototype

public StandardToStringStyle() 

Source Link

Document

Constructor.

Usage

From source file:com.nmote.smpp.Support.java

static final StandardToStringStyle getStringStye() {
    if (TO_STRING_STYLE == null) {
        TO_STRING_STYLE = new StandardToStringStyle();
        TO_STRING_STYLE.setUseShortClassName(true);
        TO_STRING_STYLE.setContentStart("(");
        TO_STRING_STYLE.setContentEnd(")");
        TO_STRING_STYLE.setContentEnd(")");
        TO_STRING_STYLE.setUseIdentityHashCode(false);
    }/*w  ww  .j  ava  2 s  .  c o m*/

    return TO_STRING_STYLE;
}

From source file:com.nmote.smpp.samples.Samples.java

/**
 * Configurates debuging styles.//from   w ww.ja  v  a 2s.  co  m
 */
public static void init() {
    StandardToStringStyle tss = new StandardToStringStyle();
    tss.setUseShortClassName(true);
    tss.setContentStart("(");
    tss.setContentEnd(")");
    tss.setUseIdentityHashCode(false);
    ToStringBuilder.setDefaultStyle(tss);
}

From source file:de.vandermeer.asciitable.commons.Table_ToStringStyle.java

/**
 * Returns the toString() style.//from   w ww.j  a va  2  s  . com
 * @return common style for toString() methods
 */
public static final ToStringStyle configure() {
    StandardToStringStyle ret = new StandardToStringStyle();

    ret.setUseShortClassName(true); //don't like long class names
    ret.setFieldNameValueSeparator(" = "); // some spaces help readability
    ret.setArrayContentDetail(true); // arrays w/ details
    ret.setDefaultFullDetail(true);

    ret.setContentStart("[");
    ret.setFieldSeparator(SystemUtils.LINE_SEPARATOR + "  ");
    ret.setFieldSeparatorAtStart(true);
    ret.setContentEnd(SystemUtils.LINE_SEPARATOR + "]");
    return ret;
}

From source file:de.vandermeer.asciitable.commons.ObjectToStringStyle.java

/**
 * Returns a standard toString() style./*from w w  w . ja  v  a  2  s .  c  o m*/
 * @param indent indentation in number of characters, useful for nested operations
 * @return common style for toString() methods
 */
public static final ToStringStyle getStyle(int indent) {
    StandardToStringStyle ret = new StandardToStringStyle();

    ret.setUseShortClassName(true); //don't like long class names
    ret.setFieldNameValueSeparator(" = "); // some spaces help readability
    ret.setArrayContentDetail(true); // arrays w/ details
    ret.setDefaultFullDetail(true);

    String indentation = "";
    for (int i = 0; i <= indent; i++) {
        indentation += " ";
    }
    ret.setContentStart("[");
    ret.setFieldSeparator(SystemUtils.LINE_SEPARATOR + indentation + "    ");
    ret.setFieldSeparatorAtStart(true);
    ret.setContentEnd(SystemUtils.LINE_SEPARATOR + indentation + "]");

    return ret;
}

From source file:de.vandermeer.skb.interfaces.categories.has.HasToStringStyle.java

/**
 * Returns a standard toString() style./*from   w  w w . java2 s . co  m*/
 * @param indent indentation in number of characters, useful for nested operations
 * @return common style for `toString()` methods
 */
default ToStringStyle getStyle(int indent) {
    StandardToStringStyle ret = new StandardToStringStyle();

    ret.setUseShortClassName(true); //don't like long class names
    ret.setFieldNameValueSeparator(" = "); // some spaces help readability
    ret.setArrayContentDetail(true); // arrays w/ details
    ret.setDefaultFullDetail(true);

    String indentation = "";
    for (int i = 0; i <= indent; i++) {
        indentation += " ";
    }
    ret.setContentStart("[");
    ret.setFieldSeparator(SystemUtils.LINE_SEPARATOR + indentation + "    ");
    ret.setFieldSeparatorAtStart(true);
    ret.setContentEnd(SystemUtils.LINE_SEPARATOR + indentation + "]");

    return ret;
}

From source file:com.uimirror.auth.form.LoginForm.java

@Override
public String toString() {
    StandardToStringStyle style = new StandardToStringStyle();
    style.setFieldSeparator(", ");
    style.setUseClassName(false);/*from   www.  j a va2 s  .c om*/
    style.setUseIdentityHashCode(false);
    return new ReflectionToStringBuilder(this, style).toString();
}