Package net.sf.gridarta.plugin.parameter
Class StringParameter<G extends GameObject<G,A,R>,A extends MapArchObject<A>,R extends Archetype<G,A,R>>
- java.lang.Object
-
- net.sf.gridarta.plugin.parameter.AbstractPluginParameter<G,A,R,V>
-
- net.sf.gridarta.plugin.parameter.AbstractValuePluginParameter<G,A,R,java.lang.String>
-
- net.sf.gridarta.plugin.parameter.StringParameter<G,A,R>
-
- All Implemented Interfaces:
PluginParameter<G,A,R,java.lang.String>
public class StringParameter<G extends GameObject<G,A,R>,A extends MapArchObject<A>,R extends Archetype<G,A,R>> extends AbstractValuePluginParameter<G,A,R,java.lang.String>
APluginParameterthat holds a string value.
-
-
Field Summary
Fields Modifier and Type Field Description static @NotNull java.lang.StringPARAMETER_TYPEThe string representation of this parameter type.
-
Constructor Summary
Constructors Constructor Description StringParameter()Creates a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description @NotNull java.lang.StringgetParameterType()Returns the parameter type name.@NotNull java.lang.StringgetStringValue()Returns the string representation of the current value 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.-
Methods inherited from class net.sf.gridarta.plugin.parameter.AbstractValuePluginParameter
getValue, getValueOrNull, setValue
-
Methods inherited from class net.sf.gridarta.plugin.parameter.AbstractPluginParameter
addPluginParameterListener, changed, getDescription, getName, removePluginParameterListener, setDescription, setName
-
-
-
-
Method Detail
-
setStringValue
public boolean setStringValue(@NotNull @NotNull java.lang.String stringValue)Description copied from interface:PluginParameterSets 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 public <T> T visit(@NotNull @NotNull PluginParameterVisitor<G,A,R,T> visitor)Description copied from interface:PluginParameterCalls 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
-
getParameterType
@NotNull public @NotNull java.lang.String getParameterType()
Description copied from interface:PluginParameterReturns the parameter type name.- Returns:
- the parameter type name
-
getStringValue
@NotNull public @NotNull java.lang.String getStringValue()
Description copied from interface:PluginParameterReturns the string representation of the current value of the parameter.- Returns:
- the string representation of the value
-
-