|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.opends.server.util.cli.MenuResult<T>
T
- The type of result value(s) contained in success results.
Use Void
if success results should not
contain values.public final class MenuResult<T>
The result of running a Menu
. The result indicates to the
application how it should proceed:
again()
- the menu should be displayed again. A good
example of this is when a user chooses to view some help. Normally,
after the help is displayed, the user is allowed to select another
option
cancel()
- the user chose to cancel any task
currently in progress and go back to the previous main menu if
applicable
success()
- the user chose to apply any task
currently in progress and go back to the previous menu if
applicable. Any result values applicable to the chosen option can
be retrieved using getValue()
or getValues()
quit()
- the user chose to quit the application and
cancel all outstanding tasks.
Method Summary | ||
---|---|---|
static
|
again()
Creates a new menu result indicating that the menu should be displayed again. |
|
static
|
cancel()
Creates a new menu result indicating that the user chose to cancel any task currently in progress and go back to the previous main menu if applicable. |
|
T |
getValue()
Gets the menu result value if this is a menu result indicating success. |
|
java.util.Collection<T> |
getValues()
Gets the menu result values if this is a menu result indicating success. |
|
boolean |
isAgain()
Determines if this menu result indicates that the menu should be displayed again. |
|
boolean |
isCancel()
Determines if this menu result indicates that the user chose to cancel any task currently in progress and go back to the previous main menu if applicable. |
|
boolean |
isQuit()
Determines if this menu result indicates that the user chose to quit the application and cancel all outstanding tasks. |
|
boolean |
isSuccess()
Determines if this menu result indicates that the user chose to apply any task currently in progress and go back to the previous menu if applicable. |
|
static
|
quit()
Creates a new menu result indicating that the user chose to quit the application and cancel all outstanding tasks. |
|
static
|
success()
Creates a new menu result indicating that the user chose to apply any task currently in progress and go back to the previous menu if applicable. |
|
static
|
success(java.util.Collection<T> values)
Creates a new menu result indicating that the user chose to apply any task currently in progress and go back to the previous menu if applicable. |
|
static
|
success(T value)
Creates a new menu result indicating that the user chose to apply any task currently in progress and go back to the previous menu if applicable. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static <T> MenuResult<T> again()
T
- The type of result value(s) contained in success
results. Use Void
if success results
should not contain values.
public static <T> MenuResult<T> cancel()
T
- The type of result value(s) contained in success
results. Use Void
if success results
should not contain values.
public static <T> MenuResult<T> quit()
T
- The type of result value(s) contained in success
results. Use Void
if success results
should not contain values.
public static <T> MenuResult<T> success()
T
- The type of result value(s) contained in success
results. Use Void
if success results
should not contain values.
public static <T> MenuResult<T> success(java.util.Collection<T> values)
getValue()
or
getValues()
.
T
- The type of the result values.values
- The result values.
getValue()
or getValues()
.public static <T> MenuResult<T> success(T value)
getValue()
or
getValues()
.
T
- The type of the result value.value
- The result value.
getValue()
or getValues()
.public T getValue()
null
if
there was no result value or if this is not a success
menu result.isSuccess()
public java.util.Collection<T> getValues()
isSuccess()
public boolean isAgain()
true
if this menu result indicates
that the menu should be displayed again.public boolean isCancel()
true
if this menu result indicates
that the user chose to cancel any task currently in
progress and go back to the previous main menu if
applicable.public boolean isQuit()
true
if this menu result indicates
that the user chose to quit the application and cancel
all outstanding tasks.public boolean isSuccess()
getValue()
or getValues()
methods.
true
if this menu result indicates
that the user chose to apply any task currently in
progress and go back to the previous menu if applicable.getValue()
,
getValues()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |