Class StateDto

java.lang.Object
com.qfs.snl.dtos.StateDto
All Implemented Interfaces:
ISentinelState, Serializable

public class StateDto extends Object implements ISentinelState, Serializable
The state data transfer object.
Author:
ActiveViam
See Also:
  • Constructor Details Link icon

    • StateDto Link icon

      public StateDto()
      Constructor.
    • StateDto Link icon

      public StateDto(String id, String caption, Double value, String formattedValue)
      Full constructor.
      Parameters:
      id - id of the state
      caption - state caption
      value - state value
      formattedValue - state formatted value
    • StateDto Link icon

      public StateDto(ISentinelState state)
      Copy constructor.
      Parameters:
      state - state to copy
  • Method Details Link icon

    • getId Link icon

      public String getId()
      Description copied from interface: ISentinelState
      Gets the id of the state.
      Specified by:
      getId in interface ISentinelState
      Returns:
      a list of strings composing the id
    • setId Link icon

      public void setId(String id)
      Sets the id of the state.
      Parameters:
      id - state id
    • getCaption Link icon

      public String getCaption()
      Description copied from interface: ISentinelState
      Return the caption of the state.
      Specified by:
      getCaption in interface ISentinelState
      Returns:
      the caption of the state
    • setCaption Link icon

      public void setCaption(String caption)
      Sets the state caption.
      Parameters:
      caption - state caption
    • getValue Link icon

      public Double getValue()
      Description copied from interface: ISentinelState
      Return the value of the state.
      Specified by:
      getValue in interface ISentinelState
      Returns:
      the value of the state
    • setValue Link icon

      public void setValue(double value)
      Sets the state value.
      Parameters:
      value - state value
    • getFormattedValue Link icon

      public String getFormattedValue()
      Description copied from interface: ISentinelState
      Return the formatted value of the state.
      Specified by:
      getFormattedValue in interface ISentinelState
      Returns:
      the formatted value of the state
    • setFormattedValue Link icon

      public void setFormattedValue(String formattedValue)
      Sets the formatted value for the state value.
      Parameters:
      formattedValue - formatted value.
    • hashCode Link icon

      public int hashCode()

      Cache the hashcode for performance reasons, as this object is not supposed to be mutable.

      Overrides:
      hashCode in class Object
    • hashCode Link icon

      public static int hashCode(ISentinelState state)
      Computes the hashcode of a state.
      Parameters:
      state - state to consider.
      Returns:
      resulting hash code
    • equals Link icon

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • equals Link icon

      public static boolean equals(ISentinelState state, Object obj)
      Tests the equality between a ISentinelState and an object.

      Two states are equals if they share the same id.

      Parameters:
      state - the reference state
      obj - the object to test
      Returns:
      true for equality
    • toString Link icon

      public String toString()
      Overrides:
      toString in class Object
    • toString Link icon

      public static String toString(ISentinelState state)
      Returns a string representation of the object.
      Parameters:
      state - state to consider
      Returns:
      a string representation of the object.
    • mapById Link icon

      public static Map<String,ISentinelState> mapById(Collection<? extends ISentinelState> states)
      Maps the states by id.
      Parameters:
      states - the states to map
      Returns:
      the mapped states