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

liquibase.diff.Difference Maven / Gradle / Ivy

There is a newer version: 3.6.2.5.inovus
Show newest version
package liquibase.diff;

public class Difference implements Comparable {
    private String message;
    private String field;
    private Object referenceValue;
    private Object comparedValue;

    public Difference(String field, Object referenceValue, Object comparedValue) {
        this(null, field, referenceValue, comparedValue);
    }

    public Difference(String message, String field, Object referenceValue, Object comparedValue) {
        if (message == null) {
            message = field+" changed from '"+referenceValue+"' to '"+comparedValue+"'";
        }
        this.message = message;
        this.field = field;
        this.referenceValue = referenceValue;
        this.comparedValue = comparedValue;
    }

    public String getMessage() {
        return message;
    }

    public String getField() {
        return field;
    }

    public Object getReferenceValue() {
        return referenceValue;
    }

    public Object getComparedValue() {
        return comparedValue;
    }

    @Override
    public String toString() {
        return message;
    }

    @Override
    public int compareTo(Object o) {
        return this.getField().compareTo(((Difference) o).getField());
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy