public class ErrorCollection extends Object implements Serializable
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 |
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() |
@Nonnull public static ErrorCollection of(@Nonnull String... messages)
messages
- an array of Strings containing error messages@Nonnull public static ErrorCollection of(@Nonnull Collection<String> messages)
messages
- an Iterable of Strings containing error messages@Nonnull public static ErrorCollection of(@Nonnull ErrorCollection errorCollection)
errorCollection
- a com.atlassian.jira.util.ErrorCollection@Nonnull public ErrorCollection addErrorCollection(@Nonnull ErrorCollection errorCollection)
errorCollection
- an ErrorCollection@Nonnull public ErrorCollection addErrorCollection(@Nonnull ErrorCollection errorCollection)
errorCollection
- an ErrorCollection@Nonnull public ErrorCollection addErrorMessage(@Nonnull String errorMessage)
errorMessage
- a String containing an error message@Nonnull public ErrorCollection addErrorMessages(@Nonnull Collection<String> messages)
messages
- a collection of Strings containing error messagespublic boolean hasAnyErrors()
@Nonnull public Collection<String> getErrorMessages()
@Nonnull public ErrorCollection reason(@Nullable ErrorCollection.Reason reason)
Copyright © 2002-2024 Atlassian. All Rights Reserved.