Package net.solarnetwork.domain
Class BasicInstruction
java.lang.Object
net.solarnetwork.domain.BasicInstruction
- All Implemented Interfaces:
Serializable,Instruction
Basic implementation of
Instruction.- Since:
- 2.0
- Version:
- 1.0
- Author:
- matt
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionBasicInstruction(Long id, String topic, Instant instructionDate, InstructionStatus status) Constructor.BasicInstruction(Instruction other, Long id, InstructionStatus status) Copy constructor.BasicInstruction(Instruction other, InstructionStatus status) Copy constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddParameter(String name, String value) Add a new parameter value.String[]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 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.voidputParameters(String name, List<String> values) Add a list of parameter values.toString()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface net.solarnetwork.domain.Instruction
getInstructionState, getParameterMap
-
Constructor Details
-
BasicInstruction
Constructor.- Parameters:
id- the local instruction IDtopic- the instruction topicinstructionDate- the instruction datestatus- the status, or null
-
BasicInstruction
Copy constructor.- Parameters:
other- the instruction to copyid- if provided, the ID to usestatus- if provided, the new status to use
-
BasicInstruction
Copy constructor.- Parameters:
other- the instruction to copystatus- if provided, the new status to use
-
-
Method Details
-
toString
-
getId
Description copied from interface:InstructionGet a unique ID for the instruction.- Specified by:
getIdin interfaceInstruction- Returns:
- local unique ID
-
getTopic
Description copied from interface:InstructionGet the topic of the instruction -- a unique identifier for the instruction type.- Specified by:
getTopicin interfaceInstruction- Returns:
- the topic name
-
getInstructionDate
Description copied from interface:InstructionGet the date/time the instruction was requested.- Specified by:
getInstructionDatein interfaceInstruction- Returns:
- the date
-
getParameterNames
Description copied from interface:InstructionGet an Iterator of all unique instruction parameter names.- Specified by:
getParameterNamesin interfaceInstruction- Returns:
- iterator, never null
-
isParameterAvailable
Description copied from interface:InstructionTest if a specific parameter has an associated value available.- Specified by:
isParameterAvailablein interfaceInstruction- Parameters:
parameterName- the parameter name to test for- Returns:
- true if the parameter name has at least one value available
-
getParameterValue
Description copied from interface:InstructionGet a single parameter value for a specific parameter name.- Specified by:
getParameterValuein interfaceInstruction- Parameters:
parameterName- the parameter name to get the value for- Returns:
- the first available parameter name, or null if not available
-
getAllParameterValues
Description copied from interface:InstructionGet all parameter values for a specific parameter name;- Specified by:
getAllParameterValuesin interfaceInstruction- Parameters:
parameterName- the parameter name to get the values for- Returns:
- all available parameter values, or null if not available
-
getStatus
Description copied from interface:InstructionGet the instruction status.- Specified by:
getStatusin interfaceInstruction- Returns:
- the status
-
addParameter
Add a new parameter value.- Parameters:
name- the parameter namevalue- the parameter value
-
putParameters
Add a list of parameter values.- Parameters:
name- the parameter namevalues- the parameter values
-
getParameterMultiMap
Description copied from interface:InstructionGet a multi-valued map of all parameter values.- Specified by:
getParameterMultiMapin interfaceInstruction- Returns:
- the parameters as a multi-valued map, never null
-