public class ButtonControl extends InteractiveControl<ButtonControl>
InteractiveControl
represents a button control on the Interactive service.meta
Constructor and Description |
---|
ButtonControl(String controlID)
Initializes a new
ButtonControl . |
ButtonControl(String controlID,
String sceneID,
InteractiveControlPosition... position)
Initializes a new
ButtonControl . |
Modifier and Type | Method and Description |
---|---|
ButtonControl |
addToCooldown(Duration duration)
Adds the provided
Duration to the existing cooldown for this ButtonControl . |
Long |
getCooldown()
Returns the UTC unix timestamp (in milliseconds) for when the cooldown for this
ButtonControl . |
Integer |
getCost()
Returns the Spark cost for this
ButtonControl . |
Integer |
getKeyCode()
Returns the keyCode for this
ButtonControl . |
Float |
getProgress()
Returns the value for the progress bar for this
ButtonControl . |
String |
getText()
Returns the text displayed on the
ButtonControl . |
protected ButtonControl |
getThis()
Returns
this as an instance of the specified generic. |
String |
getTooltip()
Returns the tooltip text displayed when the participant hovers over the button.
|
ButtonControl |
setCooldown(Instant cooldown)
Sets the UTC unix timestamp (in milliseconds) for when the cooldown for this
ButtonControl expires. |
ButtonControl |
setCooldown(Number cooldown)
Sets the UTC unix timestamp (in milliseconds) for when the cooldown for this
ButtonControl expires. |
ButtonControl |
setCost(Integer cost)
Sets the Spark cost for this
ButtonControl . |
ButtonControl |
setKeyCode(Integer keyCode)
Sets the keyCode for this
ButtonControl . |
ButtonControl |
setProgress(Float progress)
Sets the value for the progress bar for this
ButtonControl . |
ButtonControl |
setText(String text)
Sets the text to be displayed on the
ButtonControl . |
ButtonControl |
setTooltip(String tooltip)
Sets the tooltip text to be displayed when the participant hovers over the
ButtonControl . |
boolean |
syncIfEqual(Collection<?> objects)
Iterates through a
Collection of Objects. |
addPosition, compareTo, create, delete, equals, getControlID, getKind, getPositionFor, getPositionFor, getPositions, getSceneID, hashCode, hasPositionFor, hasPositionFor, isDisabled, removeAllPositions, removePosition, removePosition, setDisabled, setPositions, setPositions, update
addMetaProperty, getMeta, setMeta
public ButtonControl(String controlID)
ButtonControl
.controlID
- Unique identifier for the ButtonControl
public ButtonControl(String controlID, String sceneID, InteractiveControlPosition... position)
ButtonControl
.controlID
- Unique identifier for the ButtonControl
sceneID
- Unique identifier for the InteractiveScene
that contains this controlposition
- An array of initial InteractiveControlPosition
for this controlpublic Integer getKeyCode()
ButtonControl
.ButtonControl
public ButtonControl setKeyCode(Integer keyCode)
ButtonControl
.keyCode
- The keyCode to be used for this ButtonControl
this
for method chainingpublic String getText()
ButtonControl
.ButtonControl
public ButtonControl setText(String text)
ButtonControl
.text
- The text to be displayed on the ButtonControl
this
for method chainingpublic String getTooltip()
public ButtonControl setTooltip(String tooltip)
ButtonControl
.tooltip
- The tooltip text displayed when the participant hovers over the buttonthis
for method chainingpublic Integer getCost()
ButtonControl
.ButtonControl
public ButtonControl setCost(Integer cost)
ButtonControl
.cost
- The Spark cost for this ButtonControl
this
for method chainingpublic Float getProgress()
ButtonControl
.ButtonControl
public ButtonControl setProgress(Float progress)
ButtonControl
.progress
- The value for the progress bar for this ButtonControl
this
for method chainingpublic Long getCooldown()
ButtonControl
.
expiresButtonControl
expirespublic ButtonControl setCooldown(Number cooldown)
ButtonControl
expires.cooldown
- The UTC unix timestamp (in milliseconds) for when the cooldown for this ButtonControl
expiresthis
for method chainingpublic ButtonControl setCooldown(Instant cooldown)
ButtonControl
expires.cooldown
- The Instant
for when the cooldown for this ButtonControl
expiresthis
for method chainingpublic ButtonControl addToCooldown(Duration duration)
Duration
to the existing cooldown for this ButtonControl
.duration
- The Duration
to add to the existing cooldown timestampthis
for method chainingprotected ButtonControl getThis()
this
as an instance of the specified generic. Utilizes the
getThis
programming idiom.getThis
in class InteractiveResource<ButtonControl>
this
as an object of type TInteractiveResource.getThis()
public boolean syncIfEqual(Collection<?> objects)
Collection
of Objects. If this
is found to be in the
Collection
then this
has it's values updated.syncIfEqual
in class InteractiveResource<ButtonControl>
objects
- A Collection
of ObjectsCompletableFuture
that when complete returns true
if the
provided Collection
contains this
InteractiveResource.syncIfEqual(Collection)
Copyright © 2018. All rights reserved.