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 booleanequals(ISentinelState state, Object obj) Tests the equality between a ISentinelState and an object.booleanReturn 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.inthashCode()static inthashCode(ISentinelState state) Computes the hashcode of a state.static Map<String, ISentinelState> mapById(Collection<? extends ISentinelState> states) Maps the states by id.voidsetCaption(String caption) Sets the state caption.voidsetFormattedValue(String formattedValue) Sets the formatted value for the state value.voidSets the id of the state.voidsetValue(double value) Sets the state value.toString()static StringtoString(ISentinelState state) Returns a string representation of the object.
-
Constructor Details
-
StateDto
public StateDto()Constructor. -
StateDto
Full constructor.- Parameters:
id- id of the statecaption- state captionvalue- state valueformattedValue- state formatted value
-
StateDto
Copy constructor.- Parameters:
state- state to copy
-
-
Method Details
-
getId
Description copied from interface:ISentinelStateGets the id of the state.- Specified by:
getIdin 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:ISentinelStateReturn the caption of the state.- Specified by:
getCaptionin interfaceISentinelState- Returns:
- the caption of the state
-
setCaption
Sets the state caption.- Parameters:
caption- state caption
-
getValue
Description copied from interface:ISentinelStateReturn the value of the state.- Specified by:
getValuein 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:ISentinelStateReturn the formatted value of the state.- Specified by:
getFormattedValuein 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
-