public class

SimpleErrorCollection

extends Object
implements ErrorCollection
java.lang.Object
   ↳ com.atlassian.jira.util.SimpleErrorCollection

Summary

Public Constructors
SimpleErrorCollection()
Public Methods
void addError(String field, String message, ErrorCollection.Reason reason)
Add a field-specific error message.
void addError(String field, String message)
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<StringString> 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<StringString> 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()
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.atlassian.jira.util.ErrorCollection

Public Constructors

public SimpleErrorCollection ()

Public Methods

public void addError (String field, String message, ErrorCollection.Reason reason)

Add a field-specific error message.

Parameters
field Field name, eg. "assignee"
message Error message.
reason Reason for the error.

public void addError (String field, String message)

Add a field-specific error message.

Parameters
field Field name, eg. "assignee"
message Error message.

public void addErrorCollection (ErrorCollection errors)

Populate this ErrorCollection with general and field-specific errors.

Parameters
errors ErrorCollection whose errors/messages we obtain.

public void addErrorMessage (String message)

Add error message relating to system state (not field-specific).

Parameters
message Error message.

public void addErrorMessage (String message, ErrorCollection.Reason reason)

Add error message relating to system state (not field-specific), and a reason.

Parameters
message Error message.
reason Reason for the error.

public void addErrorMessages (Collection<String> incomingMessages)

Append new error messages to those already collected.

Parameters
incomingMessages Collection of error strings.

public void addErrors (Map<StringString> incomingErrors)

Append new field-specific errors to those already collected.

Parameters
incomingErrors of String: String pairs, eg. {"assignee": "Assignee is required"}

public void addReason (ErrorCollection.Reason reason)

Add a reason why the function has not been performed. The reasons may be used by callers of services to set return codes etc. for example in REST services.

Parameters
reason a well known reasons why the function has not been performed.

public void addReasons (Set<ErrorCollection.Reason> reasons)

Add reasons why the function has not been performed. The reasons may be used by callers of services to set return codes etc. for example in REST services.

Parameters
reasons a set of well known reasons why the function has not been performed.

public boolean equals (Object o)

public Collection<String> getErrorMessages ()

Get all non field-specific error messages.

Returns
  • Collection of error Strings.

public Map<StringString> getErrors ()

Get all field-specific errors.

Returns
  • Map of String: String pairs, eg. {"assignee": "Assignee is required"}

public Collection<String> getFlushedErrorMessages ()

Get error messages, then get rid of them.

Returns
  • The (now cleared) error messages.

public Set<ErrorCollection.Reason> getReasons ()

A set of well known reasons why the function has not been performed. The reasons may be used by callers of services to set return codes etc. for example in REST services.

Returns
  • a set of well known reasons why the function has not been performed.

public boolean hasAnyErrors ()

Whether any errors (of any type - field-specific or otherwise) have been collected.

Returns
  • true if any errors (of any type - field-specific or otherwise) have been collected.

public int hashCode ()

public void setErrorMessages (Collection<String> errorMessages)

Populate this ErrorCollection with a new set of messages (existing errors are lost).

Parameters
errorMessages List of error message Strings.

public void setReasons (Set<ErrorCollection.Reason> reasons)

Set reasons why the function has not been performed. The reasons may be used by callers of services to set return codes etc. for example in REST services.

Parameters
reasons a set of well known reasons why the function has not been performed.

public String toString ()