Class SimpleFormErrors

java.lang.Object
com.atlassian.bitbucket.validation.SimpleFormErrors
All Implemented Interfaces:
FormErrors

public class SimpleFormErrors extends Object implements FormErrors
Simple implementation of FormErrors as a plain Java object with a builder,
  • Method Details

    • getErrors

      @Nonnull public Collection<String> getErrors(@Nonnull String field)
      Specified by:
      getErrors in interface FormErrors
      Parameters:
      field - that potentially contains some errors
      Returns:
      the error in question or an empty collection
    • getFieldErrors

      @Nonnull public Map<String,Collection<String>> getFieldErrors()
      Specified by:
      getFieldErrors in interface FormErrors
      Returns:
      a map of fields to a collection of at least one associated error
    • getFormErrors

      @Nonnull public Collection<String> getFormErrors()
      Specified by:
      getFormErrors in interface FormErrors
      Returns:
      a collection of errors on the form (ie not attached to a field)
    • isEmpty

      public boolean isEmpty()
      Description copied from interface: FormErrors
      Indicates whether this instance of errors is empty, or has any errors.
      Specified by:
      isEmpty in interface FormErrors
      Returns:
      true, if this instance of FormErrors contains no errors of any type, false otherwise