Class Validation

java.lang.Object
net.pincette.jes.util.Validation

public class Validation extends Object
  • Method Details

    • validator

      public static net.pincette.jes.Reducer validator(String source, Validator validators)
      The validator is generated from source, which can be a filename or a string that starts with "resource:". In the latter case the specification will be loaded as a resource from the class path. The validator can expect the _state field to be added to the command. This way validation expressions can be written that take into account the current state of the aggregate instance.
      Parameters:
      source - the source of the validation specification.
      validators - a validator management object.
      Returns:
      The generated validation reducer.
      Since:
      1.3
      See Also:
    • validator

      public static net.pincette.jes.Reducer validator(Function<JsonObject,JsonArray> validator)
      The validator can expect the _state field to be added to the command. This way validation expressions can be written that take into account the current state of the aggregate instance.
      Parameters:
      validator - the validator.
      Returns:
      The generated validation reducer.
      Since:
      1.3.2
      See Also: