Interface IElevatorActionVariable<T>


  • public interface IElevatorActionVariable<T>
    Describes a typed, aliased variable used to configure an IElevatorAction.

    Action variables are typically parsed from an action configuration string (e.g. alias=value) and resolved at runtime to a strongly typed value.

    Defaults and invalid input

    • getDefaultObject() may be null.
    • Implementations may choose to return the default value when the input string is null or cannot be parsed.
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      T getDefaultObject()
      Returns the default value for this variable.
      @NotNull java.lang.String getMainAlias()
      Returns the primary alias used when serializing this variable (e.g., "identifier").
      T getObjectFromString​(@Nullable java.lang.String value, @NotNull IElevatorAction action)
      Converts a configuration string into a typed variable value.
      @NotNull java.lang.String getStringFromObject​(@NotNull java.lang.Object object)
      Converts a typed value into a string form suitable for serialization.
      boolean isGroupingAlias​(@NotNull java.lang.String alias)
      Returns whether the provided alias matches this variable (case-insensitive).
    • Method Detail

      • getObjectFromString

        @NotNull
        T getObjectFromString​(@Nullable
                              @Nullable java.lang.String value,
                              @NotNull
                              @NotNull IElevatorAction action)
        Converts a configuration string into a typed variable value.

        Contract:

        • action must be non-null.
        • value may be null; implementations may treat null as "use default".
        • On parse failure, implementations may return getDefaultObject().
        Parameters:
        value - the raw string value to parse; may be null
        action - the non-null action this variable belongs to (may be used for context/logging)
        Returns:
        the parsed value, or the default value if value is null or invalid
      • getStringFromObject

        @NotNull
        @NotNull java.lang.String getStringFromObject​(@NotNull
                                                      @NotNull java.lang.Object object)
        Converts a typed value into a string form suitable for serialization.

        Contract: object must be non-null.

        Parameters:
        object - the non-null value to serialize (typically of type T)
        Returns:
        the non-null string form of the value
        Throws:
        java.lang.NullPointerException - if object is null
      • getMainAlias

        @NotNull
        @NotNull java.lang.String getMainAlias()
        Returns the primary alias used when serializing this variable (e.g., "identifier").

        Contract: Never null. Aliases are typically treated case-insensitively.

        Returns:
        the non-null primary alias
      • getDefaultObject

        @NotNull
        T getDefaultObject()
        Returns the default value for this variable.

        Contract: May be null.

        Returns:
        the default value (possibly null)
      • isGroupingAlias

        boolean isGroupingAlias​(@NotNull
                                @NotNull java.lang.String alias)
        Returns whether the provided alias matches this variable (case-insensitive).

        Contract: alias must be non-null.

        Parameters:
        alias - non-null alias to test
        Returns:
        true if the alias matches this variable; otherwise false
        Throws:
        java.lang.NullPointerException - if alias is null