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

com.github.xphsc.bean.ToStringConfig Maven / Gradle / Ivy

There is a newer version: 1.2.3
Show newest version
package com.github.xphsc.bean;

import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

/**
 * Created by ${huipei.x} on 2017-6-12.
 */
public class ToStringConfig {
    private static final long serialVersionUID = 3182446945343865398L;
    public static final String DEFAULT_CONNECTOR = ",";
    public static final ToStringConfig DEFAULT_CONFIG = new ToStringConfig();
    public static final ToStringConfig IGNORE_NULL_OR_EMPTY_CONFIG = new ToStringConfig(",", false);
    private String connector = ",";
    private boolean isJoinNullOrEmpty = true;

    public ToStringConfig() {
    }

    public ToStringConfig(String connector) {
        this.connector = connector;
    }

    public ToStringConfig(String connector, boolean isJoinNullOrEmpty) {
        this.connector = connector;
        this.isJoinNullOrEmpty = isJoinNullOrEmpty;
    }

    public String getConnector() {
        return this.connector;
    }

    public void setConnector(String connector) {
        this.connector = connector;
    }

    public boolean getIsJoinNullOrEmpty() {
        return this.isJoinNullOrEmpty;
    }

    public void setIsJoinNullOrEmpty(boolean isJoinNullOrEmpty) {
        this.isJoinNullOrEmpty = isJoinNullOrEmpty;
    }

    public String toString() {
        return ToStringBuilder.reflectionToString(this, ToStringStyle.SHORT_PREFIX_STYLE);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy