public abstract static class OpacApi.MultiStepResult
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
OpacApi.MultiStepResult.Status |
Modifier and Type | Field and Description |
---|---|
static int |
ACTION_CONFIRMATION
Action type identifier for process confirmation
|
static int |
ACTION_USER
Action number to use for custom selection type identifiers.
|
protected int |
actionidentifier |
protected java.util.List<java.lang.String[]> |
details |
protected java.lang.String |
message |
protected java.util.List<java.util.Map<java.lang.String,java.lang.String>> |
selection |
protected OpacApi.MultiStepResult.Status |
status |
Constructor and Description |
---|
MultiStepResult(OpacApi.MultiStepResult.Status status)
Create a new Result object holding the return status of the operation.
|
MultiStepResult(OpacApi.MultiStepResult.Status status,
java.lang.String message)
Create a new Result object holding the return status of the operation and a message
|
Modifier and Type | Method and Description |
---|---|
int |
getActionIdentifier()
Identifier for the type of user selection if
getStatus() is
SELECTION_NEEDED . |
java.util.List<java.lang.String[]> |
getDetails()
If
getStatus() is CONFIRMATION_NEEDED , this gives you more
information to display to the user. |
java.lang.String |
getMessage() |
java.util.List<java.util.Map<java.lang.String,java.lang.String>> |
getSelection()
Get values the user should select one of if
getStatus() is
SELECTION_NEEDED . |
OpacApi.MultiStepResult.Status |
getStatus()
Get the return status of the operation.
|
void |
setActionIdentifier(int actionidentifier)
Set identifier for the type of user selection if
getStatus() is
SELECTION_NEEDED . |
void |
setDetails(java.util.List<java.lang.String[]> details)
Set details the user should confirm if
getStatus() is
CONFIRMATION_NEEDED . |
void |
setMessage(java.lang.String message)
Set an optional message, e.g. to explain an error status code
|
void |
setSelection(java.util.List<java.util.Map<java.lang.String,java.lang.String>> selection)
Set values the user should select one of if
getStatus() is set to
SELECTION_NEEDED . |
public static final int ACTION_CONFIRMATION
public static final int ACTION_USER
protected OpacApi.MultiStepResult.Status status
protected java.util.List<java.util.Map<java.lang.String,java.lang.String>> selection
protected java.util.List<java.lang.String[]> details
protected int actionidentifier
protected java.lang.String message
public MultiStepResult(OpacApi.MultiStepResult.Status status)
status
- The return statusgetStatus()
public MultiStepResult(OpacApi.MultiStepResult.Status status, java.lang.String message)
status
- The return statusmessage
- A messagegetStatus()
public OpacApi.MultiStepResult.Status getStatus()
OK
if the operation was
successful, ERROR
if the operation failed, SELECTION_NEEDED
if
the user should select one of the options presented in getSelection()
or
CONFIRMATION_NEEDED
if the user should confirm the details returned by
getDetails
. .public int getActionIdentifier()
getStatus()
is
SELECTION_NEEDED
.ACTION_
constants or a number above
ACTION_USER
.public void setActionIdentifier(int actionidentifier)
getStatus()
is
SELECTION_NEEDED
.actionidentifier
- One of the ACTION_
constants or a number above
ACTION_USER
.public java.util.List<java.util.Map<java.lang.String,java.lang.String>> getSelection()
getStatus()
is
SELECTION_NEEDED
.public void setSelection(java.util.List<java.util.Map<java.lang.String,java.lang.String>> selection)
getStatus()
is set to
SELECTION_NEEDED
.selection
- Store with key-value-tuples where the key is what is to be returned back
to reservation() and the value is what is to be displayed to the user.public java.util.List<java.lang.String[]> getDetails()
getStatus()
is CONFIRMATION_NEEDED
, this gives you more
information to display to the user. This is a list of of unknown length. Every list entry
is an array of strings that of size one or two (which can vary between the elements of
the list). If the size of such an array A is two, then A[0] contains a description of
A[1], e.g. A = {"Fee", "2 EUR"}
or A = {"Pickup location", "Central library"}
.
If the size is only one, it is a general message to be shown, e.g.
{"This action will cost 2 EUR."}
.public void setDetails(java.util.List<java.lang.String[]> details)
getStatus()
is
CONFIRMATION_NEEDED
.details
- List containing reservation details. See getDetails()
for what this means.public java.lang.String getMessage()
public void setMessage(java.lang.String message)