Package net.solarnetwork.domain
Interface Instruction
- All Known Implementing Classes:
BasicInstruction
public interface Instruction
API for a single, immutable instruction with associated parameters.
An instruction is like a single name (the topic) with an arbitrary
number of named key/value parameters. All parameter names and values are
Strings. Each parameter can have any number of associated values.
- Since:
- 2.0
- Version:
- 1.0
- Author:
- matt
-
Method Summary
Modifier and TypeMethodDescriptionString[]getAllParameterValues(String parameterName) Get all parameter values for a specific parameter name;getId()Get a unique ID for the instruction.Get the date/time the instruction was requested.Get the instruction state.Get a single-valued map of all parameter values.Get a multi-valued map of all parameter values.Get an Iterator of all unique instruction parameter names.getParameterValue(String parameterName) Get a single parameter value for a specific parameter name.Get the instruction status.getTopic()Get the topic of the instruction -- a unique identifier for the instruction type.booleanisParameterAvailable(String parameterName) Test if a specific parameter has an associated value available.
-
Method Details
-
getId
Long getId()Get a unique ID for the instruction.- Returns:
- local unique ID
-
getTopic
String getTopic()Get the topic of the instruction -- a unique identifier for the instruction type.- Returns:
- the topic name
-
getInstructionDate
Instant getInstructionDate()Get the date/time the instruction was requested.- Returns:
- the date
-
getParameterNames
Get an Iterator of all unique instruction parameter names.- Returns:
- iterator, never null
-
isParameterAvailable
Test if a specific parameter has an associated value available.- Parameters:
parameterName- the parameter name to test for- Returns:
- true if the parameter name has at least one value available
-
getParameterValue
Get a single parameter value for a specific parameter name.- Parameters:
parameterName- the parameter name to get the value for- Returns:
- the first available parameter name, or null if not available
-
getAllParameterValues
Get all parameter values for a specific parameter name;- Parameters:
parameterName- the parameter name to get the values for- Returns:
- all available parameter values, or null if not available
-
getStatus
InstructionStatus getStatus()Get the instruction status.- Returns:
- the status
-
getInstructionState
Get the instruction state.- Returns:
- the state, or null if none available
-
getParameterMap
Get a single-valued map of all parameter values.- Returns:
- the parameters as a map, never null
-
getParameterMultiMap
Get a multi-valued map of all parameter values.- Returns:
- the parameters as a multi-valued map, never null
-