Interface ValueEngineer<T>

Type Parameters:
T - Generic type, see ValueEngineerFactory.getType().

public interface ValueEngineer<T>
Engineer operating on values. Used to 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:

Since:
4.2.414
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    copy(T original)
    Create 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.
    Create an empty (initial) value.
    boolean
    isEmpty(T value)
    Check if the provided value is empty.
    read(@NotNull List<Node> nodes)
    Read the value.
    @NotNull List<Node>
    write(T value)
    Persist the given value.
  • Method Details

    • write

      @NotNull @NotNull List<Node> write(@NotNull T value)
      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

      @Nullable T read(@NotNull @NotNull List<Node> nodes)
      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

      @Nullable T getEmpty()
      Create an empty (initial) value. Implementors may return null if no special empty value treatment is needed. If the returned value is not null 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 or null.
      Since:
      4.2.414
      See Also:
    • isEmpty

      boolean isEmpty(@NotNull T value)
      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

      @NotNull T copy(@NotNull T original)
      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 its copy:
      original != copy
      For immutable objects (e.g. Strings) 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

      @Nullable <T> T getAspect(@NotNull @NotNull ValueEngineerAspectType<T> aspect)
      Request an aspect of the given type.

      The following aspects may be provided by an engineer:

      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: