Interface Paramaterized

All Known Implementing Classes:
DrawingContext.Command, DrawingContext.Modifier, Instruction, Toast

public interface Paramaterized
Represents an object that holds parameters.
  • Method Details

    • getParameters

      Gets an immutable copy of the parameters.
      Returns:
      Object Parameters
    • getParameters

      default <T> List<T> getParameters(@NotNull @NotNull Class<T> type)
      Gets the parameters of the specified type.
      Type Parameters:
      T - The type of the parameters
      Parameters:
      type - The type of the parameters to get
      Returns:
      The parameters of the specified type
    • parameter

      @NotNull default @NotNull Object parameter(int index) throws IllegalArgumentException
      Gets the parameter at the specified index.
      Parameters:
      index - The index of the parameter to get
      Returns:
      The parameter at the specified index
      Throws:
      IllegalArgumentException - if the index is out of bounds
    • firstParameter

      default Object firstParameter()
      Gets the first parameter.
      Returns:
      The first parameter
    • lastParameter

      default Object lastParameter()
      Gets the last parameter.
      Returns:
      The last parameter
    • parameter

      @NotNull default <T> T parameter(int index, @NotNull @NotNull Class<T> type) throws IllegalArgumentException
      Gets the parameter at the specified index.
      Type Parameters:
      T - The type of the parameter
      Parameters:
      index - The index of the parameter to get
      Returns:
      The parameter at the specified index
      Throws:
      IllegalArgumentException - if the index is out of bounds or type is null
    • parameter

      @NotNull default <T> T parameter(int index, @NotNull @NotNull Class<T> type, @NotNull T def) throws IllegalArgumentException
      Gets the parameter at the specified index.
      Type Parameters:
      T - The type of the parameter
      Parameters:
      index - The index of the parameter to get
      type - The type of the parameter
      def - The default value to return if the parameter is null
      Returns:
      The parameter at the specified index
      Throws:
      IllegalArgumentException - if the index is out of bounds, type is null, or def is null
    • firstParameter

      @NotNull default <T> T firstParameter(@NotNull @NotNull Class<T> type) throws IllegalArgumentException
      Gets the first parameter.
      Type Parameters:
      T - The type of the parameter
      Parameters:
      type - The type of the parameter
      Returns:
      The first parameter
      Throws:
      IllegalArgumentException - if type is null
    • lastParameter

      @NotNull default <T> T lastParameter(@NotNull @NotNull Class<T> type) throws IllegalArgumentException
      Gets the last parameter.
      Type Parameters:
      T - The type of the parameter
      Parameters:
      type - The type of the parameter
      Returns:
      The last parameter
      Throws:
      IllegalArgumentException - if type is null
    • intParameter

      default int intParameter(int index)
      Gets a parameter as an integer.
      Parameters:
      index - The index of the parameter to get
      Returns:
      The parameter at the specified index as an integer
    • intParameter

      default int intParameter(int index, int def)
      Gets a parameter as an integer.
      Parameters:
      index - The index of the parameter to get
      def - The default value to return if the parameter is null
      Returns:
      The parameter at the specified index as an integer
    • firstIntParameter

      default int firstIntParameter()
      Gets the first parameter as an integer.
      Returns:
      The first parameter as an integer
    • lastIntParameter

      default int lastIntParameter()
      Gets the last parameter as an integer.
      Returns:
      The last parameter as an integer
    • longParameter

      default long longParameter(int index)
      Gets a parameter as a long.
      Parameters:
      index - The index of the parameter to get
      Returns:
      The parameter at the specified index as a long
    • longParameter

      default long longParameter(int index, long def)
      Gets a parameter as a long.
      Parameters:
      index - The index of the parameter to get
      def - The default value to return if the parameter is null
      Returns:
      The parameter at the specified index as a long
    • firstLongParameter

      default long firstLongParameter()
      Gets the first parameter as a long.
      Returns:
      The first parameter as a long
    • lastLongParameter

      default long lastLongParameter()
      Gets the last parameter as a long.
      Returns:
      The last parameter as a long
    • floatParameter

      default float floatParameter(int index)
      Gets a parameter as a float.
      Parameters:
      index - The index of the parameter to get
      Returns:
      The parameter at the specified index as a float
    • floatParameter

      default float floatParameter(int index, float def)
      Gets a parameter as a float.
      Parameters:
      index - The index of the parameter to get
      def - The default value to return if the parameter is null
      Returns:
      The parameter at the specified index as a float
    • firstFloatParameter

      default float firstFloatParameter()
      Gets the first parameter as a float.
      Returns:
      The first parameter as a float
    • lastFloatParameter

      default float lastFloatParameter()
      Gets the last parameter as a float.
      Returns:
      The last parameter as a float
    • doubleParameter

      default double doubleParameter(int index)
      Gets a parameter as a double.
      Parameters:
      index - The index of the parameter to get
      Returns:
      The parameter at the specified index as a double
    • doubleParameter

      default double doubleParameter(int index, double def)
      Gets a parameter as a double.
      Parameters:
      index - The index of the parameter to get
      def - The default value to return if the parameter is null
      Returns:
      The parameter at the specified index as a double
    • firstDoubleParameter

      default double firstDoubleParameter()
      Gets the first parameter as a double.
      Returns:
      The first parameter as a double
    • lastDoubleParameter

      default double lastDoubleParameter()
      Gets the last parameter as a double.
      Returns:
      The last parameter as a double
    • booleanParameter

      default boolean booleanParameter(int index)
      Gets a parameter as a boolean.
      Parameters:
      index - The index of the parameter to get
      Returns:
      The parameter at the specified index as a boolean
    • booleanParameter

      default boolean booleanParameter(int index, boolean def)
      Gets a parameter as a boolean.
      Parameters:
      index - The index of the parameter to get
      def - The default value to return if the parameter is null
      Returns:
      The parameter at the specified index as a boolean
    • firstBooleanParameter

      default boolean firstBooleanParameter()
      Gets the first parameter as a boolean.
      Returns:
      The first parameter as a boolean
    • lastBooleanParameter

      default boolean lastBooleanParameter()
      Gets the last parameter as a boolean.
      Returns:
      The last parameter as a boolean
    • stringParameter

      @NotNull default @NotNull String stringParameter(int index)
      Gets a parameter as a string.
      Parameters:
      index - The index of the parameter to get
      Returns:
      The parameter at the specified index as a string
    • stringParameter

      @NotNull default @NotNull String stringParameter(int index, @NotNull @NotNull String def)
      Gets a parameter as a string.
      Parameters:
      index - The index of the parameter to get
      def - The default value to return if the parameter is null
      Returns:
      The parameter at the specified index as a string
    • firstStringParameter

      @NotNull default @NotNull String firstStringParameter()
      Gets the first parameter as a string.
      Returns:
      The first parameter as a string
    • lastStringParameter

      @NotNull default @NotNull String lastStringParameter()
      Gets the last parameter as a string.
      Returns:
      The last parameter as a string