@PublicApi
public interface ErrorCollection
addError(String, String)
), and general errors
(addErrorMessage(String)
) that aren't field-specific (eg. permission problems).Modifier and Type | Interface and Description |
---|---|
static class |
ErrorCollection.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> errorMessages)
Append new error messages to those already collected.
|
void |
addErrors(Map<String,String> errors)
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.
|
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.
|
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.
|
void addError(String field, String message)
field
- Field name, eg. "assignee"message
- Error message.void addError(String field, String message, ErrorCollection.Reason reason)
field
- Field name, eg. "assignee"message
- Error message.reason
- Reason for the error.void addErrorMessage(String message)
message
- Error message.void addErrorMessage(String message, ErrorCollection.Reason reason)
message
- Error message.reason
- Reason for the error.Collection<String> getErrorMessages()
void setErrorMessages(Collection<String> errorMessages)
errorMessages
- List of error message String
s.Collection<String> getFlushedErrorMessages()
Map<String,String> getErrors()
void addErrorCollection(ErrorCollection errors)
errors
- ErrorCollection whose errors/messages we obtain.void addErrorMessages(Collection<String> errorMessages)
errorMessages
- Collection of error strings.void addErrors(Map<String,String> errors)
errors
- of String: String pairs, eg. {"assignee": "Assignee is required"}boolean hasAnyErrors()
void addReasons(Set<ErrorCollection.Reason> reasons)
reasons
- a set of well known reasons why the function has not been performed.void addReason(ErrorCollection.Reason reason)
reason
- a well known reasons why the function has not been performed.void setReasons(Set<ErrorCollection.Reason> reasons)
reasons
- a set of well known reasons why the function has not been performed.Set<ErrorCollection.Reason> getReasons()
Copyright © 2002-2015 Atlassian. All Rights Reserved.