
se.wfh.libs.common.gui.widgets.events.DataChangedEvent Maven / Gradle / Ivy
package se.wfh.libs.common.gui.widgets.events;
import java.util.EventObject;
public class DataChangedEvent extends EventObject {
public static enum ChangeType {
CHANGING,
COMMIT,
ROLLBACK,
}
private static final long serialVersionUID = 3L;;
private final ChangeType why;
private final Object newVal;
private final Object oldVal;
public DataChangedEvent(Object source, Object oldVal, Object newVal,
ChangeType why) {
super(source);
this.oldVal = oldVal;
this.newVal = newVal;
this.why = why;
}
public Object getNewValue() {
return newVal;
}
public Object getOldValue() {
return oldVal;
}
public ChangeType getWhy() {
return why;
}
@Override
public String toString() {
return this.getClass().getSimpleName() + " [source=" + getSource() + ", "
+ oldVal + " --> " + newVal + "]";
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy