@ExperimentalApi public class ErrorCollections extends Object
ErrorCollection instances.
All instances returned by methods in this class are Serializable.
| Constructor and Description |
|---|
ErrorCollections() |
| Modifier and Type | Method and Description |
|---|---|
static ErrorCollection |
copyOf(ErrorCollection errorCollection)
Creates a new error collection with contents copied from the supplied argument.
|
static ErrorCollection |
create(String errorMessage,
ErrorCollection.Reason reason)
Creates a new instance of error collection that contains the specified message and reason.
|
static ErrorCollection |
create(String field,
String message,
ErrorCollection.Reason reason)
Creates a new instance of error collection that contains the
message related to the field because of reason. |
static ErrorCollection |
empty()
Creates a new instance of empty error collection.
|
static ErrorCollection |
join(ErrorCollection... errorCollections)
Creates an error collection containing all errors from given error collections
|
static ErrorCollection |
validationError(String field,
String message)
Creates a new instance of error collection that indicates there was a validation error for the specified field.
|
public static ErrorCollection empty()
public static ErrorCollection create(String errorMessage, ErrorCollection.Reason reason)
errorMessage - error message to be contained in the returned collectionreason - reason for the messagepublic static ErrorCollection create(String field, String message, ErrorCollection.Reason reason)
message related to the field because of reason.field - field that the error message will pertain tomessage - error message related to the fieldreason - reason for errorpublic static ErrorCollection validationError(String field, String message)
This is equivalent to calling create(String, String, com.atlassian.jira.util.ErrorCollection.Reason)
with the same field and message arguments and reason ErrorCollection.Reason.VALIDATION_FAILED.
field - field that failed validationmessage - detailed error messageErrorCollection.Reason.VALIDATION_FAILEDpublic static ErrorCollection copyOf(ErrorCollection errorCollection)
errorCollection - error collection to copypublic static ErrorCollection join(ErrorCollection... errorCollections)
errorCollections - an array of error collections to joinCopyright © 2002-2019 Atlassian. All Rights Reserved.