I would like to iterate through fields (perhaps annotated fields) and compare their values.
The method signature would look like this:
public void compareAndCopy(final Object source, final Object dest)
If the values are equal, nothing happens, otherwise then the source value will be copied to the destination field.
Does anyone know of any standard or de facto standard (ie Apache Commons) for such an algorithm? I am not afraid to roll it myself, I would just like to know if it exists.
Aucun commentaire:
Enregistrer un commentaire