public String getNewValue ( String strKey , String strReadValue , String strOrigValue , String strCurrentValue ) { String strNewValue = null ; if ( ( ( strCurrentValue != null ) && ( strCurrentValue . equals ( strOrigValue ) ) ) || ( ( strCurrentValue == null ) && ( strOrigValue == null ) ) ) { // I have't changed it, so use the read value strNewValue = strReadValue ; } else if ( ( ( strReadValue != null ) && ( strReadValue . equals ( strOrigValue ) ) ) || ( ( strReadValue == null ) && ( strOrigValue == null ) ) ) { // Someone else didn't change it, use current value strNewValue = strCurrentValue ; } else if ( ( ( strReadValue != null ) && ( strReadValue . equals ( strCurrentValue ) ) ) || ( ( strReadValue == null ) && ( strCurrentValue == null ) ) ) { // The read value and my value are the same... good, use it strNewValue = strCurrentValue ; } else { // All three values are different... figure out which to use strNewValue = this . mergeKey ( strKey , strReadValue , strCurrentValue ) ; // I HAVE changed it, so I need to figure out which one is better } return strNewValue ; }
Given the read original and current values for this key decide which to use .