Package net.sf.gridarta.plugin.parameter
Interface PluginParameter<G extends GameObject<G,A,R>,A extends MapArchObject<A>,R extends Archetype<G,A,R>,V>
-
- All Known Implementing Classes:
AbstractPathParameter,AbstractPluginParameter,AbstractStringPluginParameter,AbstractValuePluginParameter,ArchetypeParameter,BooleanParameter,DoubleParameter,IntegerParameter,MapParameter,MapPathParameter,StringParameter
public interface PluginParameter<G extends GameObject<G,A,R>,A extends MapArchObject<A>,R extends Archetype<G,A,R>,V>Parameter for a Plugin.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaddPluginParameterListener(@NotNull PluginParameterListener listener)Adds alistenerto be notified.@NotNull java.lang.StringgetDescription()The user-provided description of the value for the user interface.@NotNull java.lang.StringgetName()The name of the parameter.@NotNull java.lang.StringgetParameterType()Returns the parameter type name.@NotNull java.lang.StringgetStringValue()Returns the string representation of the current value of the parameter.VgetValue()Returns the current value of this parameter.VgetValueOrNull()Returns the current value of this parameter.voidremovePluginParameterListener(@NotNull PluginParameterListener listener)Removes alistenerto be notified.voidsetDescription(@NotNull java.lang.String description)Sets the user-provided description of the value for the user interface.voidsetName(@NotNull java.lang.String name)Sets the name of the parameter.booleansetStringValue(@NotNull java.lang.String stringValue)Sets the parameter value from string representation.<T> Tvisit(@NotNull PluginParameterVisitor<G,A,R,T> visitor)Calls thevisit()function for this parameter type.
-
-
-
Method Detail
-
addPluginParameterListener
void addPluginParameterListener(@NotNull @NotNull PluginParameterListener listener)Adds alistenerto be notified.- Parameters:
listener- the listener
-
removePluginParameterListener
void removePluginParameterListener(@NotNull @NotNull PluginParameterListener listener)Removes alistenerto be notified.- Parameters:
listener- the listener
-
getName
@NotNull @NotNull java.lang.String getName()
The name of the parameter. It identifies the parameter in the user interface and from the plugin script code.- Returns:
- the name
-
setName
void setName(@NotNull @NotNull java.lang.String name)Sets the name of the parameter. It identifies the parameter in the user interface and from the plugin script code.- Parameters:
name- the name
-
getParameterType
@NotNull @NotNull java.lang.String getParameterType()
Returns the parameter type name.- Returns:
- the parameter type name
-
getDescription
@NotNull @NotNull java.lang.String getDescription()
The user-provided description of the value for the user interface.- Returns:
- the description
-
setDescription
void setDescription(@NotNull @NotNull java.lang.String description)Sets the user-provided description of the value for the user interface.- Parameters:
description- the description
-
getValue
@NotNull V getValue() throws InvalidValueException
Returns the current value of this parameter.- Returns:
- the value
- Throws:
InvalidValueException- if the the value is invalid
-
getValueOrNull
@Nullable V getValueOrNull()
Returns the current value of this parameter.- Returns:
- the value or
nullif the the value is invalid
-
getStringValue
@NotNull @NotNull java.lang.String getStringValue()
Returns the string representation of the current value of the parameter.- Returns:
- the string representation of the value
-
setStringValue
boolean setStringValue(@NotNull @NotNull java.lang.String stringValue)Sets the parameter value from string representation.- Parameters:
stringValue- the string representation of the value to set- Returns:
trueif the value was accepted orfalseif the value was not changed because the new value is invalid
-
visit
@NotNull <T> T visit(@NotNull @NotNull PluginParameterVisitor<G,A,R,T> visitor)Calls thevisit()function for this parameter type.- Type Parameters:
T- the visitor-specific type of the return value- Parameters:
visitor- the visitor to call- Returns:
- a visitor-specific return value
-
-