public interface PluginParameter<G extends GameObject<G,A,R>,A extends MapArchObject<A>,R extends Archetype<G,A,R>,V>
Modifier and Type | Method and Description |
---|---|
void |
addPluginParameterListener(PluginParameterListener listener)
Adds a
listener to be notified. |
java.lang.String |
getDescription()
The user-provided description of the value for the user interface.
|
java.lang.String |
getName()
The name of the parameter.
|
java.lang.String |
getParameterType()
Returns the parameter type name.
|
java.lang.String |
getStringValue()
Returns the string representation of the current value of the parameter.
|
V |
getValue()
Returns the current value of this parameter.
|
V |
getValueOrNull()
Returns the current value of this parameter.
|
void |
removePluginParameterListener(PluginParameterListener listener)
Removes a
listener to be notified. |
void |
setDescription(java.lang.String description)
Sets the user-provided description of the value for the user interface.
|
void |
setName(java.lang.String name)
Sets the name of the parameter.
|
boolean |
setStringValue(java.lang.String stringValue)
Sets the parameter value from string representation.
|
<T> T |
visit(PluginParameterVisitor<G,A,R,T> visitor)
Calls the
visit() function for this parameter type. |
void addPluginParameterListener(@NotNull PluginParameterListener listener)
listener
to be notified.listener
- the listenervoid removePluginParameterListener(@NotNull PluginParameterListener listener)
listener
to be notified.listener
- the listener@NotNull java.lang.String getName()
void setName(@NotNull java.lang.String name)
name
- the name@NotNull java.lang.String getParameterType()
@NotNull java.lang.String getDescription()
void setDescription(@NotNull java.lang.String description)
description
- the description@NotNull V getValue() throws InvalidValueException
InvalidValueException
- if the the value is invalid@Nullable V getValueOrNull()
null
if the the value is invalid@NotNull java.lang.String getStringValue()
boolean setStringValue(@NotNull java.lang.String stringValue)
stringValue
- the string representation of the value to settrue
if the value was accepted or false
if the
value was not changed because the new value is invalid@NotNull <T> T visit(@NotNull PluginParameterVisitor<G,A,R,T> visitor)
visit()
function for this parameter type.T
- the visitor-specific type of the return valuevisitor
- the visitor to call