1 package org.pojomatic.diff;
2
3 import java.util.NoSuchElementException;
4
5 /**
6 * A difference between two objects, 'left' and 'right'.
7 */
8 public interface Difference {
9
10 /**
11 * The name of the property.
12 *
13 * @return the name of the property
14 */
15 String propertyName();
16
17 /**
18 * The value from the left instance (possibly {@code null}).
19 *
20 * @return the value from the left instance (possibly {@code null})
21 * @throws NoSuchElementException if the value does not exist on the left instance
22 */
23 Object leftValue() throws NoSuchElementException;
24
25 /**
26 * The value from the right instance (possibly {@code null}).
27 *
28 * @return the value from the right instance (possibly {@code null})
29 * @throws NoSuchElementException if the value does not exist on the right instance
30 */
31 Object rightValue() throws NoSuchElementException;
32
33 }