Interface ConfigBeanBuilderValidator.ValidationRound

All Superinterfaces:
AttributeVisitor<Object>
Enclosing interface:
ConfigBeanBuilderValidator<CBB>

public static interface ConfigBeanBuilderValidator.ValidationRound extends AttributeVisitor<Object>
Represents a single round of validation. A single round of validation will iterate over each attributes of the config bean, calling validate(String, Supplier, Class, java.util.Map) for each attribute.
  • Method Details

    • issues

      All the issues found.
      Returns:
      all issues found
    • hasIssues

      default boolean hasIssues()
      Returns true if there were any issues found including warnings or errors.
      Returns:
      true if any issues were found
    • hasErrors

      default boolean hasErrors()
      Returns true if any errors were found.
      Returns:
      true if any issues were found of type ConfigBeanBuilderValidator.Severity.ERROR
    • isCompleted

      boolean isCompleted()
      Returns true if the validation round is completed.
      Returns:
      true if the validation round is completed
      See Also:
    • validate

      ConfigBeanBuilderValidator.ValidationRound validate(String attributeName, Supplier<?> valueSupplier, Class<?> cbType, Map<String,Object> meta)
      Performs a validation for a single attribute.
      Parameters:
      attributeName - the attribute name being validated
      valueSupplier - the value supplier for the attribute
      cbType - the attribute type
      meta - the meta attributes for this attribute type
      Returns:
      the validation round continuation as a fluent-builder
    • visit

      default void visit(String attributeName, Supplier<Object> valueSupplier, Map<String,Object> meta, Object userDefinedCtx, Class<?> cbType, Class<?>... ignored)
      Description copied from interface: AttributeVisitor
      Visits the attribute named 'attrName'.
      Specified by:
      visit in interface AttributeVisitor<Object>
      Parameters:
      attributeName - the attribute name
      valueSupplier - the attribute value supplier
      meta - the meta information for the attribute
      userDefinedCtx - a user defined context that can be used for holding an object of your choosing
      cbType - the type of the attribute
      ignored - the type arguments (if type is a parameterized / generic type)
    • finish

      ConfigBeanBuilderValidator.ValidationRound finish(boolean throwIfErrors)
      Finishes the validation round, and will optionally throw a runtime exception if any error issues were found.
      Parameters:
      throwIfErrors - flag to indicate whether an exception should be raised if any errors were found
      Returns:
      the fluent builder for this round
      Throws:
      IllegalStateException - if there were any validation errors in the round