public class ErrorCollection extends Object
ErrorCollection
useful for returning via JSON or XML.Constructor and Description |
---|
ErrorCollection() |
Modifier and Type | Method and Description |
---|---|
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() |
public static ErrorCollection of(String... messages)
messages
- an array of Strings containing error messagespublic static ErrorCollection of(Collection<String> messages)
messages
- an Iterable of Strings containing error messagespublic static ErrorCollection of(ErrorCollection errorCollection)
errorCollection
- a com.atlassian.jira.util.ErrorCollectionpublic ErrorCollection addErrorCollection(ErrorCollection errorCollection)
errorCollection
- an ErrorCollectionpublic ErrorCollection addErrorMessage(String errorMessage)
errorMessage
- a String containing an error messagepublic ErrorCollection addErrorMessages(Collection<String> messages)
messages
- a collection of Strings containing error messagespublic boolean hasAnyErrors()
public Collection<String> getErrorMessages()
public ErrorCollection reason(ErrorCollection.Reason reason)
public Integer getStatus()
Copyright © 2002-2019 Atlassian. All Rights Reserved.