001package io.ebean; 002 003/** 004 * Holds two values as the result of a difference comparison. 005 */ 006public class ValuePair { 007 008 protected Object newValue; 009 010 protected Object oldValue; 011 012 /** 013 * Default constructor for JSON tools. 014 */ 015 public ValuePair() { 016 } 017 018 /** 019 * Construct with the pair of new and old values. 020 */ 021 public ValuePair(Object newValue, Object oldValue) { 022 this.newValue = newValue; 023 this.oldValue = oldValue; 024 } 025 026 /** 027 * Return the new value. 028 */ 029 public Object getNewValue() { 030 return newValue; 031 } 032 033 /** 034 * Return the old value. 035 */ 036 public Object getOldValue() { 037 return oldValue; 038 } 039 040 /** 041 * Set the new value. 042 */ 043 public void setNewValue(Object newValue) { 044 this.newValue = newValue; 045 } 046 047 /** 048 * Set the old value. 049 */ 050 public void setOldValue(Object oldValue) { 051 this.oldValue = oldValue; 052 } 053 054 @Override 055 public String toString() { 056 return newValue + "," + oldValue; 057 } 058}