
org.beanone.ValueDiff Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of beanone Show documentation
Show all versions of beanone Show documentation
A utility library that allows one to easily manage the history of a JavaBean
The newest version!
package org.beanone;
import java.io.Serializable;
/**
* Stores the value differences in a BeanPatch. A ValueDiff has no meaning when
* used outside of a {@link BeanPatch}. It is useful only if used inside a
* BeanPatch.
*
*
* This is immutable.
*
*
* @author Hongyan Li
*
*/
public class ValueDiff implements Serializable {
private static final long serialVersionUID = 750309839430474647L;
// note that if these member attributes are declared as Serializable, then
// Gson is going to fail on de-serialization.
private String oldValue;
private String newValue;
public ValueDiff() {
// default constructor to make this a valid JavaBean
}
public static ValueDiff makeDiff(String oldValue, String newValue) {
final ValueDiff returns = new ValueDiff();
returns.oldValue = oldValue;
returns.newValue = newValue;
return returns;
}
public String getNewValue() {
return newValue;
}
public String getOldValue() {
return oldValue;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy