All Known Implementing Classes:
DuplexMode, IntrusionStatus, LinkStatus, NeedsCleaning, PredictedFailure

public interface IState
Interface representing a generic state.
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Get the numeric value associated with the state.
    static <T extends IState>
    Optional<T>
    interpret(String state, @NonNull Map<String,T> stateTranslations, @NonNull Class<T> type)
    Interpret the given state value based on the stateTranslations lookup.
  • Method Details

    • getNumericValue

      int getNumericValue()
      Get the numeric value associated with the state.
      Returns:
      The numeric value as int
    • interpret

      static <T extends IState> Optional<T> interpret(String state, @NonNull @NonNull Map<String,T> stateTranslations, @NonNull @NonNull Class<T> type)
      Interpret the given state value based on the stateTranslations lookup.
      Type Parameters:
      T - Type extending IState
      Parameters:
      state - The state value to interpret
      stateTranslations - The translation lookup from which we get IState by key
      type - The type used to cast the result
      Returns:
      Optional of T extends IState