@PublicApi public class SimpleErrorCollection extends Object implements ErrorCollection
ErrorCollection.Reason| Constructor and Description |
|---|
SimpleErrorCollection() |
SimpleErrorCollection(ErrorCollection errorCollection) |
SimpleErrorCollection(List<String> errorMessages,
Set<ErrorCollection.Reason> reasons) |
SimpleErrorCollection(String errorMessage) |
SimpleErrorCollection(String errorMsg,
ErrorCollection.Reason reason) |
| Modifier and Type | Method and Description |
|---|---|
void |
addError(String field,
String message)
Add a field-specific error message.
|
void |
addError(String field,
String message,
ErrorCollection.Reason reason)
Add a field-specific error message.
|
void |
addErrorCollection(ErrorCollection errors)
Populate this ErrorCollection with general and field-specific errors.
|
void |
addErrorMessage(String message)
Add error message relating to system state (not field-specific).
|
void |
addErrorMessage(String message,
ErrorCollection.Reason reason)
Add error message relating to system state (not field-specific), and a reason.
|
void |
addErrorMessages(Collection<String> incomingMessages)
Append new error messages to those already collected.
|
void |
addErrors(Map<String,String> incomingErrors)
Append new field-specific errors to those already collected.
|
void |
addReason(ErrorCollection.Reason reason)
Add a reason why the function has not been performed.
|
void |
addReasons(Set<ErrorCollection.Reason> reasons)
Add reasons why the function has not been performed.
|
boolean |
equals(Object o) |
Collection<String> |
getErrorMessages()
Get all non field-specific error messages.
|
Map<String,String> |
getErrors()
Get all field-specific errors.
|
Collection<String> |
getFlushedErrorMessages()
Get error messages, then get rid of them.
|
Set<ErrorCollection.Reason> |
getReasons()
A set of well known reasons why the function has not been performed.
|
boolean |
hasAnyErrors()
Whether any errors (of any type - field-specific or otherwise) have been collected.
|
int |
hashCode() |
void |
setErrorMessages(Collection<String> errorMessages)
Populate this ErrorCollection with a new set of messages (existing errors are lost).
|
void |
setReasons(Set<ErrorCollection.Reason> reasons)
Set reasons why the function has not been performed.
|
String |
toString() |
public SimpleErrorCollection()
public SimpleErrorCollection(String errorMessage)
public SimpleErrorCollection(String errorMsg, ErrorCollection.Reason reason)
public SimpleErrorCollection(List<String> errorMessages, Set<ErrorCollection.Reason> reasons)
public SimpleErrorCollection(ErrorCollection errorCollection)
public void addError(String field, String message)
ErrorCollectionaddError in interface ErrorCollectionfield - Field name, eg. "assignee"message - Error message.public void addErrorMessage(String message)
ErrorCollectionaddErrorMessage in interface ErrorCollectionmessage - Error message.public Collection<String> getErrorMessages()
ErrorCollectiongetErrorMessages in interface ErrorCollectionpublic void setErrorMessages(Collection<String> errorMessages)
ErrorCollectionsetErrorMessages in interface ErrorCollectionerrorMessages - List of error message Strings.public Collection<String> getFlushedErrorMessages()
ErrorCollectiongetFlushedErrorMessages in interface ErrorCollectionpublic Map<String,String> getErrors()
ErrorCollectiongetErrors in interface ErrorCollectionpublic void addErrorCollection(ErrorCollection errors)
ErrorCollectionaddErrorCollection in interface ErrorCollectionerrors - ErrorCollection whose errors/messages we obtain.public void addErrorMessages(Collection<String> incomingMessages)
ErrorCollectionaddErrorMessages in interface ErrorCollectionincomingMessages - Collection of error strings.public void addErrors(Map<String,String> incomingErrors)
ErrorCollectionaddErrors in interface ErrorCollectionincomingErrors - of String: String pairs, eg. {"assignee": "Assignee is required"}public boolean hasAnyErrors()
ErrorCollectionhasAnyErrors in interface ErrorCollectionpublic void addError(String field, String message, ErrorCollection.Reason reason)
ErrorCollectionaddError in interface ErrorCollectionfield - Field name, eg. "assignee"message - Error message.reason - Reason for the error.public void addErrorMessage(String message, ErrorCollection.Reason reason)
ErrorCollectionaddErrorMessage in interface ErrorCollectionmessage - Error message.reason - Reason for the error.public void addReason(ErrorCollection.Reason reason)
ErrorCollectionaddReason in interface ErrorCollectionreason - a well known reasons why the function has not been performed.public void addReasons(Set<ErrorCollection.Reason> reasons)
ErrorCollectionaddReasons in interface ErrorCollectionreasons - a set of well known reasons why the function has not been performed.public void setReasons(Set<ErrorCollection.Reason> reasons)
ErrorCollectionsetReasons in interface ErrorCollectionreasons - a set of well known reasons why the function has not been performed.public Set<ErrorCollection.Reason> getReasons()
ErrorCollectiongetReasons in interface ErrorCollectionCopyright © 2002-2022 Atlassian. All Rights Reserved.