Package com.qfs.snl.dtos
Class StateDto
java.lang.Object
com.qfs.snl.dtos.StateDto
- All Implemented Interfaces:
ISentinelState
,Serializable
The state data transfer object.
- Author:
- ActiveViam
- See Also:
-
Field Summary
Fields inherited from interface com.qfs.snl.data.ISentinelState
TABLE_NAME
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
equals
(ISentinelState state, Object obj) Tests the equality between a ISentinelState and an object.boolean
Return the caption of the state.Return the formatted value of the state.getId()
Gets the id of the state.getValue()
Return the value of the state.int
hashCode()
static int
hashCode
(ISentinelState state) Computes the hashcode of a state.static Map
<String, ISentinelState> mapById
(Collection<? extends ISentinelState> states) Maps the states by id.void
setCaption
(String caption) Sets the state caption.void
setFormattedValue
(String formattedValue) Sets the formatted value for the state value.void
Sets the id of the state.void
setValue
(double value) Sets the state value.toString()
static String
toString
(ISentinelState state) Returns a string representation of the object.
-
Constructor Details
-
Method Details
-
getId
Description copied from interface:ISentinelState
Gets the id of the state.- Specified by:
getId
in interfaceISentinelState
- Returns:
- a list of strings composing the id
-
setId
Sets the id of the state.- Parameters:
id
- state id
-
getCaption
Description copied from interface:ISentinelState
Return the caption of the state.- Specified by:
getCaption
in interfaceISentinelState
- Returns:
- the caption of the state
-
setCaption
Sets the state caption.- Parameters:
caption
- state caption
-
getValue
Description copied from interface:ISentinelState
Return the value of the state.- Specified by:
getValue
in interfaceISentinelState
- Returns:
- the value of the state
-
setValue
public void setValue(double value) Sets the state value.- Parameters:
value
- state value
-
getFormattedValue
Description copied from interface:ISentinelState
Return the formatted value of the state.- Specified by:
getFormattedValue
in interfaceISentinelState
- Returns:
- the formatted value of the state
-
setFormattedValue
Sets the formatted value for the state value.- Parameters:
formattedValue
- formatted value.
-
hashCode
public int hashCode()Cache the hashcode for performance reasons, as this object is not supposed to be mutable.
-
hashCode
Computes the hashcode of a state.- Parameters:
state
- state to consider.- Returns:
- resulting hash code
-
equals
-
equals
Tests the equality between a ISentinelState and an object.Two states are equals if they share the same id.
- Parameters:
state
- the reference stateobj
- the object to test- Returns:
- true for equality
-
toString
-
toString
Returns a string representation of the object.- Parameters:
state
- state to consider- Returns:
- a string representation of the object.
-
mapById
Maps the states by id.- Parameters:
states
- the states to map- Returns:
- the mapped states
-