Interface IErrorList

All Superinterfaces:
Collection<IError>, ICloneable<ICommonsList<IError>>, ICommonsCollection<IError>, ICommonsIterable<IError>, ICommonsList<IError>, IHasErrorLevels<IError>, IHasSize, Iterable<IError>, List<IError>, SequencedCollection<IError>
All Known Implementing Classes:
ErrorList

Interface for a list of IError objects.
Since:
8.5.0
Author:
Philip Helger
  • Method Details

    • hasNoEntryForField

      default boolean hasNoEntryForField(@Nullable String sSearchFieldName)
      Check if no entry for the specified field is present
      Parameters:
      sSearchFieldName - The field name to search.
      Returns:
      true if no entry for the specified field is present
    • hasNoEntryForFields

      default boolean hasNoEntryForFields(@Nullable String... aSearchFieldNames)
      Check if no entry for the specified fields are present
      Parameters:
      aSearchFieldNames - The field names to search.
      Returns:
      true if no entry for any of the specified fields is present
    • hasEntryForField

      default boolean hasEntryForField(@Nullable String sSearchFieldName)
      Check if any entry for the specified field is present
      Parameters:
      sSearchFieldName - The field name to search.
      Returns:
      true if an entry for the specified field is present
    • hasEntryForField

      default boolean hasEntryForField(@Nullable String sSearchFieldName, @Nullable IErrorLevel aErrorLevel)
      Check if any entry for the specified field and the specified error level is present
      Parameters:
      sSearchFieldName - The field name to search.
      aErrorLevel - The exact form error level to search. May not be null
      Returns:
      true if an entry for the specified field is present that has exactly the specified form error level
    • hasErrorForField

      default boolean hasErrorForField(@Nullable String sSearchFieldName)
      Check if any error entry for the specified field is present
      Parameters:
      sSearchFieldName - The field name to search.
      Returns:
      true if an error entry for the specified field is present
    • hasEntryForFields

      default boolean hasEntryForFields(@Nullable String... aSearchFieldNames)
      Check if any entry for the specified fields are present
      Parameters:
      aSearchFieldNames - The field names to search.
      Returns:
      true if an entry for at least one of the specified fields is present
    • getListOfField

      @Nonnull @ReturnsMutableCopy default IErrorList getListOfField(@Nullable String sSearchFieldName)
      Get a sub-list with all entries for the specified field name
      Parameters:
      sSearchFieldName - The field name to search.
      Returns:
      Never null.
    • getListOfFields

      @Nonnull @ReturnsMutableCopy default IErrorList getListOfFields(@Nullable String... aSearchFieldNames)
      Get a sub-list with all entries for the specified field names
      Parameters:
      aSearchFieldNames - The field names to search.
      Returns:
      Never null.
    • getListOfFields

      @Nonnull @ReturnsMutableCopy default IErrorList getListOfFields(@Nullable Collection<String> aSearchFieldNames)
      Get a sub-list with all entries for the specified field names
      Parameters:
      aSearchFieldNames - The field names to search.
      Returns:
      Never null.
    • getListOfFieldsStartingWith

      @Nonnull @ReturnsMutableCopy default IErrorList getListOfFieldsStartingWith(@Nullable String... aSearchFieldNames)
      Get a sub-list with all entries that have field names starting with one of the supplied names.
      Parameters:
      aSearchFieldNames - The field names to search.
      Returns:
      Never null.
    • getListOfFieldsRegExp

      @Nonnull @ReturnsMutableCopy default IErrorList getListOfFieldsRegExp(@Nonnull @Nonempty @RegEx String sRegExp)
      Get a sub-list with all entries that have field names matching the passed regular expression.
      Parameters:
      sRegExp - The regular expression to compare the entries against.
      Returns:
      Never null.
    • getListWithoutField

      @Nonnull @ReturnsMutableCopy default IErrorList getListWithoutField()
      Get a sub-list with all entries that does not contain an error field name.
      Returns:
      Never null.
    • getAllFailures

      @Nonnull default IErrorList getAllFailures()
      Get a resource error group containing only the failure elements. All error levels except EErrorLevel.SUCCESS are considered to be a failure!
      Returns:
      A non-null error list containing only the failures.
    • getAllErrors

      @Nonnull default IErrorList getAllErrors()
      Get a resource error group containing only the error elements. All error levels ≥ EErrorLevel.ERROR are considered to be an error!
      Returns:
      A non-null error list containing only the errors.
    • getSubList

      Get a sub-list with all entries that match the provided predicate.
      Parameters:
      aFilter - The filter to be used. May be null in which a copy is returned.
      Returns:
      Never null.
    • getAllTexts

      @Nonnull @ReturnsMutableCopy default ICommonsList<String> getAllTexts(@Nonnull Locale aContentLocale)
      Get a list with all contained texts.
      Parameters:
      aContentLocale - The content locale to used. May not be null.
      Returns:
      Never null.
    • getAllDataItems

      @Nonnull @ReturnsMutableCopy default <T> ICommonsList<T> getAllDataItems(@Nonnull Function<? super IError,? extends T> aExtractor)
      Get a list with only a single data element.
      Type Parameters:
      T - Type to extract from IError.
      Parameters:
      aExtractor - The data extractor to be used. May not be null.
      Returns:
      Never null.
    • getGroupedByID

      Returns:
      A map with all items mapped from error ID to its occurrences.
    • getGroupedByFieldName

      Returns:
      A map with all items mapped from error field name to its occurrences.
    • getGrouped

      @Nonnull @ReturnsMutableCopy default <T> ICommonsOrderedMap<T,ICommonsList<IError>> getGrouped(@Nonnull Function<? super IError,T> aKeyExtractor)
      Type Parameters:
      T - Return list key type
      Parameters:
      aKeyExtractor - the key extractor by which the result is grouped.
      Returns:
      A map with all items mapped from a key to its occurrences.