public class ActionForm extends AForm
| Modifier and Type | Class and Description |
|---|---|
static class |
ActionForm.Button
A button of an action form.
|
DEFAULT_TRANSLATOR, translator| Constructor and Description |
|---|
ActionForm(java.lang.String title,
java.lang.String text,
ActionForm.Button... buttons) |
| Modifier and Type | Method and Description |
|---|---|
static ActionFormBuilder |
builder() |
void |
deserializeResponse(java.lang.String response)
Deserialize the response of the form from a string.
|
ActionForm.Button[] |
getButtons() |
int |
getClickedButton()
Get the clicked button of the form.
|
java.lang.String |
getText() |
java.lang.String |
getText(boolean translate)
Get the text of the form.
|
java.lang.String |
serializeResponse()
Serialize the response of the form to a string.
|
void |
setClickedButton(int clickedButton)
Set the clicked button of the form.
|
void |
setTranslator(java.util.function.Function<java.lang.String,java.lang.String> translator)
Set the translator for the form.
|
getTitle, getTitle, getTranslator, getTypepublic ActionForm(@Nonnull
java.lang.String title,
@Nonnull
java.lang.String text,
@Nonnull
ActionForm.Button... buttons)
title - The title of the formtext - The text displayed in the formbuttons - The buttons of the formpublic static ActionFormBuilder builder()
public void setTranslator(@Nonnull
java.util.function.Function<java.lang.String,java.lang.String> translator)
AFormsetTranslator in class AFormtranslator - The translatorpublic java.lang.String getText()
@Nonnull public java.lang.String getText(boolean translate)
translate - If the text should be translated@Nonnull public ActionForm.Button[] getButtons()
public void setClickedButton(int clickedButton)
clickedButton - The clicked buttonpublic int getClickedButton()
public java.lang.String serializeResponse()
AFormserializeResponse in class AFormpublic void deserializeResponse(java.lang.String response)
deserializeResponse in class AFormresponse - The serialized responsejava.lang.NumberFormatException - If the response is not a number