All Downloads are FREE. Search and download functionalities are using the official Maven repository.

nl.vpro.domain.ToString Maven / Gradle / Ivy

Go to download

Several domains like 'media', pages' and 'subtitles' in the POMS system share some common properties which are collected here

There is a newer version: 8.3.1
Show newest version
package nl.vpro.domain;

import java.io.Serial;

import org.apache.commons.lang3.builder.*;


/**
 * @since 5.28
 */
public class ToString {

    private ToString() {

    }

    public static final ToStringStyle STYLE;
    static {
        StandardToStringStyle style = new StandardToStringStyle() {
            @Serial
            private static final long serialVersionUID = -4020286714849246315L;

            @Override
            protected void appendDetail(final StringBuffer buffer, final String fieldName, final Object value) {
                if (value instanceof CharSequence) {
                    buffer.append('\'');
                }
                super.appendDetail(buffer, fieldName, value);
                if (value instanceof CharSequence) {
                    buffer.append('\'');
                }
            }

        };
        style.setUseShortClassName(true);
        style.setUseIdentityHashCode(false);
        style.setContentEnd("}");
        style.setContentStart("{");
        style.setArrayStart("[");
        style.setArrayEnd("]");
        style.setFieldSeparator(", ");
        STYLE = style;
    }

    public static ToStringBuilder builder(Object object) {
        return new ToStringBuilder(object, ToString.STYLE);
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy