Package org.sensorhub.api.command
Class CommandResult
java.lang.Object
org.sensorhub.api.command.CommandResult
- All Implemented Interfaces:
ICommandResult
Immutable class used to describe the result of a command
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected BigId
protected Collection<BigId>
protected Collection<IObsData>
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiontoString()
static ICommandResult
Add data to a command resultstatic ICommandResult
withEntireDatastream
(BigId dataStreamID) Declare an entire datastream as resultstatic ICommandResult
withObs
(Collection<IObsData> obsList) Add observations to a command resultstatic ICommandResult
withObsInDatastream
(BigId dataStreamID, Collection<BigId> obsIDs) Declare certain obs from an existing datastream as resultstatic ICommandResult
withSingleObs
(IObsData obs) Add observations to a command result
-
Field Details
-
dataStreamID
-
obsIDs
-
obsList
-
-
Constructor Details
-
CommandResult
protected CommandResult()
-
-
Method Details
-
withEntireDatastream
Declare an entire datastream as result- Parameters:
dataStreamID
- The ID of the datastream that contains the result- Returns:
- The result object
-
withObsInDatastream
Declare certain obs from an existing datastream as result- Parameters:
dataStreamID
- The ID of the datastream that contains the resultobsIDs
- IDs of observations that constitute the result- Returns:
- The result object
-
withObs
Add observations to a command result- Parameters:
obsList
- List of observations to be added to the datastream of the result- Returns:
- The result object
-
withSingleObs
Add observations to a command result- Parameters:
obs
- A single observation to return as the result- Returns:
- The result object
-
withData
Add data to a command result- Parameters:
data
- A single observation result to return as the command result- Returns:
- The result object
-
getObservations
- Specified by:
getObservations
in interfaceICommandResult
- Returns:
- inline result data, as a list of observations matching the
result schema defined by
ICommandStreamInfo
-
getObservationRefs
- Specified by:
getObservationRefs
in interfaceICommandResult
- Returns:
- reference to observations (when not provided inline) generated during the execution of the command and added to one or more existing datastream(s).
-
getDataStreamID
- Specified by:
getDataStreamID
in interfaceICommandResult
- Returns:
- reference to an entire datastream that contains one or more observations (but usually many) generated during the execution of the command.
-
toString
-