public class FlowResult extends Object
Basically, this results object stores all the errors and continuation states that need to be represented. There are four types of information stored:
1) Continuation, this is a simple boolean variable that indicates whether the required operation is complete and the user may continue on to the next step.
2) Notice information, this is a simple encoding of a notice message to be displayed to the user on their next step. There are four parts: outcome, header, message, and characters. See each field for more description on each part. Note: either a message or characters are required.
3) Errors, this is a list of errors that were encountered during processing. Typically, it just consists of a list of errored fields. However occasionally there may be other specialized errors listed.
4) Parameters, this is a map of attached parameters that may be relevant to the result. This should be used for things such as generated id's when objects are newly created.
| Constructor and Description |
|---|
FlowResult() |
| Modifier and Type | Method and Description |
|---|---|
void |
addError(String newError)
Add a new single error to the error list.
|
String |
getCharacters()
Return the notice characters
|
boolean |
getContinue()
Determine if the user should progress to the
next step in the flow.
|
List<String> |
getErrors()
Return the current list of errors.
|
String |
getErrorString()
Return the list of errors in string form, i.e.
|
String |
getHeader()
Return the notice header.
|
String |
getMessage()
return the notice message.
|
String |
getOutcome()
Get the notice outcome in string form, either success
or failure.
|
Object |
getParameter(String name)
Find the attached parameter with the given name.
|
void |
setCharacters(String characters)
Set the notice characters.
|
void |
setContinue(boolean continuep)
Set the continuation parameter determining if the
user should progress to the next step in the flow.
|
void |
setErrors(List<String> errors)
Set the results errors, note this will remove any previous errors.
|
void |
setHeader(Message header)
Set the notice header.
|
void |
setMessage(Message message)
Set the notice message.
|
void |
setOutcome(boolean success)
Set the notice outcome to either success or failure.
|
void |
setParameter(String name,
Object value)
Attach a new parameter to this result object with the specified
name and value.
|
public void setContinue(boolean continuep)
continuep - true if should continue.public boolean getContinue()
public void setOutcome(boolean success)
success - True for success, false for failure.public String getOutcome()
public void setHeader(Message header)
header - the header.public String getHeader()
public void setMessage(Message message)
message - the message.public String getMessage()
public void setCharacters(String characters)
characters - the notice.public String getCharacters()
public void setErrors(List<String> errors)
errors - New error list.public void addError(String newError)
newError - New error.public List<String> getErrors()
public String getErrorString()
public void setParameter(String name, Object value)
name - The parameter's namevalue - The parameter's value.Copyright © 2016 DuraSpace. All rights reserved.