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 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

      Iterable<String> getParameterNames()
      Get an Iterator of all unique instruction parameter names.
      Returns:
      iterator, never null
    • isParameterAvailable

      boolean isParameterAvailable(String parameterName)
      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

      String getParameterValue(String parameterName)
      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

      String[] getAllParameterValues(String parameterName)
      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

      default InstructionStatus.InstructionState getInstructionState()
      Get the instruction state.
      Returns:
      the state, or null if none available
    • getParameterMap

      default Map<String,String> getParameterMap()
      Get a single-valued map of all parameter values.
      Returns:
      the parameters as a map, never null
    • getParameterMultiMap

      default Map<String,List<String>> getParameterMultiMap()
      Get a multi-valued map of all parameter values.
      Returns:
      the parameters as a multi-valued map, never null