Package net.sf.gridarta.plugin.parameter
Class ArchetypeParameter<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.AbstractStringPluginParameter<G,A,R,Archetype<G,A,R>>
-
- net.sf.gridarta.plugin.parameter.ArchetypeParameter<G,A,R>
-
- All Implemented Interfaces:
PluginParameter<G,A,R,Archetype<G,A,R>>
public class ArchetypeParameter<G extends GameObject<G,A,R>,A extends MapArchObject<A>,R extends Archetype<G,A,R>> extends AbstractStringPluginParameter<G,A,R,Archetype<G,A,R>>
APluginParameterthat holds anArchetypevalue.
-
-
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 ArchetypeParameter(@NotNull ArchetypeSet<G,A,R> archetypeSet)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 Archetype<G,A,R>getValue()Returns the current value of this parameter.@Nullable Archetype<G,A,R>getValueOrNull()Returns the current value of this parameter.<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.AbstractStringPluginParameter
getStringValue, setStringValue
-
Methods inherited from class net.sf.gridarta.plugin.parameter.AbstractPluginParameter
addPluginParameterListener, changed, getDescription, getName, removePluginParameterListener, setDescription, setName
-
-
-
-
Constructor Detail
-
ArchetypeParameter
public ArchetypeParameter(@NotNull @NotNull ArchetypeSet<G,A,R> archetypeSet)Creates a new instance.- Parameters:
archetypeSet- the archetype set for looking up archetypes
-
-
Method Detail
-
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
-
getValue
@NotNull public @NotNull Archetype<G,A,R> getValue() throws InvalidValueException
Description copied from interface:PluginParameterReturns the current value of this parameter.- Returns:
- the value
- Throws:
InvalidValueException- if the the value is invalid
-
getValueOrNull
@Nullable public @Nullable Archetype<G,A,R> getValueOrNull()
Description copied from interface:PluginParameterReturns the current value of this parameter.- Returns:
- the value or
nullif the the value is invalid
-
getParameterType
@NotNull public @NotNull java.lang.String getParameterType()
Description copied from interface:PluginParameterReturns the parameter type name.- Returns:
- the parameter type name
-
-