|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
T - Value type, same as in ValueEngineerpublic interface DifferenceComputing<T>
Aspect for ValueEngineers providing means to compute differences between values.
Difference| Field Summary | |
|---|---|
static ValueEngineerAspectType<DifferenceComputing<?>> |
TYPE
Aspect for ValueEngineers providing means to compute differences between values. |
| Method Summary | |
|---|---|
List<Difference> |
computeDifferences(T actualValue,
T oldValue)
Compute the list of differences between the two provided values. |
| Field Detail |
|---|
static final ValueEngineerAspectType<DifferenceComputing<?>> TYPE
ValueEngineers providing means to compute differences between values.
| Method Detail |
|---|
@NotNull
List<Difference> computeDifferences(@NotNull
T actualValue,
@NotNull
T oldValue)
null is handled by the framework which will create a list with one difference, containing the actual
value as contrast.
If the two values have no differences, implementors could return an empty list.
For computing differences on the values details (e.g., for two strings), the following guideline describes the meaning of the types of modification:
NONE - If a detail hasn't changed.DELETED - If a detail has been removed.INSERTED - If a detail has been inserted.CHANGED - If a detail has been changed.actualValue == "This is the actual value!", oldValue == "This is the old value."
a list with one entry could be returned:
return Collections.singletonList(new Difference(actualValue, CHANGED));
Or a more detailed list of differences:
return Arrays.asList(
new Difference("This is the ", NONE),
new Difference("actual", INSERTED),
new Difference("old", DELETED),
new Difference(" value", NONE),
new Difference("!", INSERTED),
new Difference(".", DELETED));
actualValue - The actual value.oldValue - The former value.
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||