Interface ValueEngineer<T>
- Type Parameters:
T
- Generic type, seeValueEngineerFactory.getType()
.
persist
values and
read(List read)
values back from persistence. Implementations may
provide further functionality on values through aspects
.
The broker provided to methods of this interface and implemented aspects offers additional, specialized agents:
ReferenceTransformationAgent
for transforming reference containers to elements
- Since:
- 4.2.414
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionCreate a copy of the given value, i.e., it produces a new instance having the same contents.<T> T
getAspect
(@NotNull ValueEngineerAspectType<T> aspect) Request an aspect of the given type.getEmpty()
Create an empty (initial) value.boolean
Check if the provided value is empty.Read the value.Persist the given value.
-
Method Details
-
write
Persist the given value.- Parameters:
value
- The value to write as list of nodes.- Returns:
- A list of nodes representing the given value.
- Since:
- 4.2.414
- See Also:
-
read
Read the value.If instances are language specific pay attention to inject the correct language in the returned instance. You can obtain the language from
ValueEngineerContext.getLanguage()
.- Parameters:
nodes
- The nodes representing a value.- Returns:
- The read value.
- Since:
- 4.2.414
- See Also:
-
getEmpty
Create an empty (initial) value. Implementors may returnnull
if no special empty value treatment is needed. If the returned value is notnull
the following condition should hold:isEmpty(getEmpty()) == true
If instances are language specific pay attention to inject the correct language in the returned instance. You can obtain the language from
ValueEngineerContext.getLanguage()
.- Returns:
- An empty instance of type
T
ornull
. - Since:
- 4.2.414
- See Also:
-
isEmpty
Check if the provided value is empty.- Parameters:
value
- Value to check.- Returns:
true
if the provided value is empty.- Since:
- 4.2.414
- See Also:
-
copy
Create a copy of the given value, i.e., it produces a new instance having the same contents. Changing the original instance should have no effect on the copy.For mutable object the following condition should hold for a given
original
and itscopy
:
original != copy
For immutable objects (e.g.String
s) you may return the provided original itself.If instances are language specific pay attention to inject the correct language in the returned instance. You can obtain the language from
ValueEngineerContext.getLanguage()
.- Parameters:
original
- The value to be copied.- Returns:
- A clone of the value.
- Since:
- 4.2.414
-
getAspect
Request an aspect of the given type.The following aspects may be provided by an engineer:
ReferenceContaining
, if the value may contain store element referencesMatchSupporting
, if the value supports indexing and searchingDifferenceComputing
, if the engineer provides means to compute differences between valuesValidationSupporting
, if the engineer provides means to validate values
- Parameters:
aspect
- The aspect requested.- Returns:
- The according aspect providing instance or
null
, if the requested aspect is not supported. - Since:
- 4.2.414
- See Also:
-