Interface PluginParameter<G extends GameObject<G,​A,​R>,​A extends MapArchObject<A>,​R extends Archetype<G,​A,​R>,​V>

    • Method Detail

      • addPluginParameterListener

        void addPluginParameterListener​(@NotNull
                                        @NotNull PluginParameterListener listener)
        Adds a listener to be notified.
        Parameters:
        listener - the listener
      • removePluginParameterListener

        void removePluginParameterListener​(@NotNull
                                           @NotNull PluginParameterListener listener)
        Removes a listener to 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
      • getValueOrNull

        @Nullable
        V getValueOrNull()
        Returns the current value of this parameter.
        Returns:
        the value or null if 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:
        true if the value was accepted or false if 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 the visit() 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