Class ErrorCollection

java.lang.Object
com.atlassian.jira.rest.api.util.ErrorCollection
All Implemented Interfaces:
Serializable

public class ErrorCollection extends Object implements Serializable
A JAXB representation of an ErrorCollection useful for returning via JSON or XML.
Since:
v4.2
See Also:
  • Constructor Details

    • ErrorCollection

      public ErrorCollection()
  • Method Details

    • of

      @Nonnull public static ErrorCollection of(@Nonnull String... messages)
      Returns a new ErrorCollection containing a list of error messages.
      Parameters:
      messages - an array of Strings containing error messages
      Returns:
      a new ErrorCollection
    • of

      @Nonnull public static ErrorCollection of(@Nonnull Collection<String> messages)
      Returns a new ErrorCollection containing a list of error messages.
      Parameters:
      messages - an Iterable of Strings containing error messages
      Returns:
      a new ErrorCollection
    • of

      @Nonnull public static ErrorCollection of(@Nonnull ErrorCollection errorCollection)
      Returns a new ErrorCollection containing all the errors contained in the input error collection.
      Parameters:
      errorCollection - a com.atlassian.jira.util.ErrorCollection
      Returns:
      a new ErrorCollection
    • addErrorCollection

      @Nonnull public ErrorCollection addErrorCollection(@Nonnull ErrorCollection errorCollection)
      Adds all the errors and error messages that are in the given error collection to this error collection.
      Parameters:
      errorCollection - an ErrorCollection
      Returns:
      this
    • addErrorCollection

      @Nonnull public ErrorCollection addErrorCollection(@Nonnull ErrorCollection errorCollection)
      Adds all the errors and error messages that are in the given error collection to this error collection.
      Parameters:
      errorCollection - an ErrorCollection
      Returns:
      this
    • addErrorMessage

      @Nonnull public ErrorCollection addErrorMessage(@Nonnull String errorMessage)
      Adds the given error message to this error collection.
      Parameters:
      errorMessage - a String containing an error message
      Returns:
      this
    • addErrorMessages

      @Nonnull public ErrorCollection addErrorMessages(@Nonnull Collection<String> messages)
      Adds the given error messages to this error collection.
      Parameters:
      messages - a collection of Strings containing error messages
      Returns:
      this
    • hasAnyErrors

      public boolean hasAnyErrors()
      Returns true if this error collection contains errors or error messages.
      Returns:
      true if this error collection contains errors or error messages.
    • getErrorMessages

      @Nonnull public Collection<String> getErrorMessages()
    • getErrors

      @Nonnull public Map<String,String> getErrors()
    • reason

      @Nonnull public ErrorCollection reason(@Nullable ErrorCollection.Reason reason)
    • getStatus

      @Nullable public Integer getStatus()
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object