Class DefaultValidation

java.lang.Object
kos.core.validation.DefaultValidation
All Implemented Interfaces:
Validation

public class DefaultValidation extends Object implements Validation
A predicate-based Validation.
  • Field Details

    • validationCache

      private final Map<Class,Validation> validationCache
    • fallbackValidation

      private Validation fallbackValidation
      The fallback Validation implementation. It will be called whenever no other validation is available for a given type.
  • Constructor Details

    • DefaultValidation

      public DefaultValidation()
  • Method Details

    • memorise

      public void memorise(Validation validation)
    • validate

      public io.vertx.core.Future validate(Object object, Class targetClass)
      Description copied from interface: Validation
      Validates the object. It is expected that the validated object will be returned in the successful Future result.
      Specified by:
      validate in interface Validation
      Parameters:
      object - the object to be validated
    • populateWithClassAndItsInterfaces

      private void populateWithClassAndItsInterfaces(Queue<Class> stack, Class klass)
    • getTypeOfTheObjectBeingValidated

      public Class<Object> getTypeOfTheObjectBeingValidated()
      Description copied from interface: Validation
      Returns a static representation of the object being validated.
      Specified by:
      getTypeOfTheObjectBeingValidated in interface Validation