Package net.solarnetwork.domain
Interface InstructionStatus
- All Known Implementing Classes:
BasicInstructionStatus
public interface InstructionStatus
Status information for a single Instruction.
- Since:
- 2.0
- Version:
- 1.0
- Author:
- matt
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic enumAn enumeration of instruction states. -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic InstructionStatuscreateStatus(Instruction instruction, InstructionStatus.InstructionState state, Instant date, Map<String, ?> resultParameters) Create a new status for a given instruction.Get the ID of the instruction this state is associated with.Get the current instruction state.Get result parameters.Get the date/time the instruction state was queried.default InstructionStatusCreate a new InstructionStatus copy with a new state.newCopyWithState(InstructionStatus.InstructionState newState, Map<String, ?> resultParameters) Create a new InstructionStatus copy with a new state and result parameters.
-
Field Details
-
MESSAGE_RESULT_PARAM
A standard result parameter key for a message (typically an error message).- See Also:
-
ERROR_CODE_RESULT_PARAM
A standard result parameter key for an error code.- See Also:
-
-
Method Details
-
getInstructionId
Long getInstructionId()Get the ID of the instruction this state is associated with.- Returns:
- the primary key
-
getInstructionState
InstructionStatus.InstructionState getInstructionState()Get the current instruction state.- Returns:
- the current instruction state
-
getStatusDate
Instant getStatusDate()Get the date/time the instruction state was queried.- Returns:
- the status date
-
getResultParameters
Get result parameters.- Returns:
- the result parameters, or null if none available
-
newCopyWithState
Create a new InstructionStatus copy with a new state.- Parameters:
newState- the new state- Returns:
- the new instance
-
newCopyWithState
InstructionStatus newCopyWithState(InstructionStatus.InstructionState newState, Map<String, ?> resultParameters) Create a new InstructionStatus copy with a new state and result parameters.- Parameters:
newState- the new stateresultParameters- the result parameters- Returns:
- the new instance
- Since:
- 1.1
-
createStatus
static InstructionStatus createStatus(Instruction instruction, InstructionStatus.InstructionState state, Instant date, Map<String, ?> resultParameters) Create a new status for a given instruction.- Parameters:
instruction- the instruction, or nullstate- the new statedate- the status dateresultParameters- the optional result parameters- Returns:
- the status, never null
-