com.atlassian.jira.rest.api.util
Class ErrorCollection

java.lang.Object
  extended by com.atlassian.jira.rest.api.util.ErrorCollection

public class ErrorCollection
extends Object

A JAXB representation of an ErrorCollection useful for returning via JSON or XML.

Since:
v4.2

Constructor Summary
ErrorCollection()
           
 
Method Summary
 ErrorCollection addErrorCollection(ErrorCollection errorCollection)
          Adds all the errors and error messages that are in the given error collection to this error collection.
 ErrorCollection addErrorMessage(String errorMessage)
          Adds the given error message to this error collection.
 ErrorCollection addErrorMessages(Collection<String> messages)
          Adds the given error messages to this error collection.
 boolean equals(Object o)
           
 Collection<String> getErrorMessages()
           
 Map<String,String> getErrors()
           
 Integer getStatus()
           
 boolean hasAnyErrors()
          Returns true if this error collection contains errors or error messages.
 int hashCode()
           
static ErrorCollection of(Collection<String> messages)
          Returns a new ErrorCollection containing a list of error messages.
static ErrorCollection of(ErrorCollection errorCollection)
          Returns a new ErrorCollection containing all the errors contained in the input error collection.
static ErrorCollection of(String... messages)
          Returns a new ErrorCollection containing a list of error messages.
 ErrorCollection reason(ErrorCollection.Reason reason)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ErrorCollection

public ErrorCollection()
Method Detail

of

public static ErrorCollection of(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

public static ErrorCollection of(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

public static ErrorCollection of(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

public ErrorCollection addErrorCollection(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

public ErrorCollection addErrorMessage(String errorMessage)
Adds the given error message to this error collection.

Parameters:
errorMessage - a String containing an error message
Returns:
this

addErrorMessages

public ErrorCollection addErrorMessages(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

public Collection<String> getErrorMessages()

getErrors

public Map<String,String> getErrors()

reason

public ErrorCollection reason(ErrorCollection.Reason reason)

getStatus

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


Copyright © 2002-2012 Atlassian. All Rights Reserved.