Class AS4ErrorList

java.lang.Object
com.helger.phase4.error.AS4ErrorList
All Implemented Interfaces:
Iterable<AS4Error>

public class AS4ErrorList extends Object implements Iterable<AS4Error>
Specific list of AS4Error objects
Since:
4.2.0
Author:
Philip Helger
  • Constructor Details

    • AS4ErrorList

      public AS4ErrorList()
  • Method Details

    • add

      public @NonNull AS4ErrorList add(@NonNull Ebms3Error aError)
      Add an EBMS Error to the list. It is internally wrapped into an AS4Error. No special HTTP Status code can be provided with this method.
      Parameters:
      aError - The error to be added. May not be null.
      Returns:
      this for chaining
    • add

      public @NonNull AS4ErrorList add(@NonNull AS4Error aError)
      Add an error to the list.
      Parameters:
      aError - The error to be added. May not be null.
      Returns:
      this for chaining
    • addAll

      public @NonNull AS4ErrorList addAll(@NonNull AS4ErrorList aOther)
      Add another error list to this list
      Parameters:
      aOther - the error list to be added. May not be null.
      Returns:
      this for chaining
    • getAllMapped

      @ReturnsMutableCopy public <T> @NonNull com.helger.collection.commons.ICommonsList<T> getAllMapped(@NonNull Function<? super AS4Error,T> aFunc)
      Get a mapped list of all contained errors.
      Type Parameters:
      T - The destination type.
      Parameters:
      aFunc - The function to be invoked for each error in the list. May not be null.
      Returns:
      A non-null but maybe empty list of mapped elements.
    • forEach

      public void forEach(@NonNull Consumer<? super AS4Error> aConsumer)
      Iterate over each contained error with the provided consumer.
      Specified by:
      forEach in interface Iterable<AS4Error>
    • isEmpty

      public boolean isEmpty()
      Returns:
      true if the list is empty, false if not.
      See Also:
    • isNotEmpty

      public boolean isNotEmpty()
      Returns:
      true if the list is not empty, false if it is.
      See Also:
    • size

      @Nonnegative public int size()
      Returns:
      The number of errors contained. Must be ≥ 0.
    • iterator

      public @NonNull Iterator<AS4Error> iterator()
      Get an iterator over all contained errors.
      Specified by:
      iterator in interface Iterable<AS4Error>
    • toString

      public String toString()
      Overrides:
      toString in class Object