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

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

Introduction

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

Prototype

@Override
public void setFieldNameValueSeparator(final String fieldNameValueSeparator) 

Source Link

Document

Sets the field name value separator text.

null is accepted, but will be converted to an empty String.

Usage

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

/**
 * Returns a standard toString() style.//w  w  w.j  a  v  a2s .co 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.asciitable.commons.Table_ToStringStyle.java

/**
 * Returns the toString() style.//  w  ww .ja v a2 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.skb.interfaces.categories.has.HasToStringStyle.java

/**
 * Returns a standard toString() style.// w ww  .  j ava  2  s . com
 * @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;
}