Interface ConstraintValidator<T>

    • Method Detail

      • validate

        void validate​(T actual,
                      HttpModelType httpModelType,
                      String modelName)
        Validates the single actual.

        The state of the actual must not be altered.

        Parameters:
        actual - the actual value to validate
        httpModelType - the http model type
        modelName - the parameter or header name
        Throws:
        io.rxmicro.http.error.ValidationException - if actual does not pass the constraint
      • validate

        default void validate​(T model)
        Validates the root model.

        The state of the model must not be altered.

        Parameters:
        model - the root model to validate
        Throws:
        io.rxmicro.http.error.ValidationException - if value does not pass the constraint
      • validateIterable

        default void validateIterable​(Iterable<T> iterable,
                                      HttpModelType httpModelType,
                                      String modelName)
        Validates all items from the iterable.

        The state of the iterable must not be altered.

        If the iterable is null validator does not throw ValidationException.

        Parameters:
        iterable - the iterable to validate
        httpModelType - the http model type
        modelName - the parameter or header name
        Throws:
        io.rxmicro.http.error.ValidationException - if value does not pass the constraint
      • validateIterable

        default void validateIterable​(Iterable<T> models)
        Validates all items from the iterable.

        The state of the value must not be altered.

        If the iterable is null validator does not throw ValidationException.

        Parameters:
        models - the model list to validate
        Throws:
        io.rxmicro.http.error.ValidationException - if value does not pass the constraint
      • validateMapValues

        default void validateMapValues​(Map<String,​T> map,
                                       HttpModelType httpModelType,
                                       String modelName)
        Validates the map values.

        The state of the map must not be altered.

        Parameters:
        map - the map with values to validate
        httpModelType - the http model type
        modelName - the parameter or header name
        Throws:
        io.rxmicro.http.error.ValidationException - if value does not pass the constraint
      • validateMapValues

        default void validateMapValues​(Map<String,​T> map)
        Validates the root model map values.

        The state of the map must not be altered.

        Parameters:
        map - the map with values to validate
        Throws:
        io.rxmicro.http.error.ValidationException - if value does not pass the constraint