Package net.solarnetwork.node.domain
Interface DataAccessor
- All Known Subinterfaces:
AcEnergyDataAccessor,DcEnergyDataAccessor
public interface DataAccessor
API for accessing properties from a snapshot of data captured from a device.
- Since:
- 1.60
- Version:
- 2.0
- Author:
- matt
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringKey for the manufacture date, as aLocalDate.static final StringKey for the manufacturer, as a String.static final StringKey for the model, as a String.static final StringKey for the name, as a String.static final StringKey for the serial number, as a Long.static final StringKey for the version (e.g. -
Method Summary
Modifier and TypeMethodDescriptiondefault net.solarnetwork.domain.DeviceInfoGet aDeviceInfoinstance based on thegetDeviceInfo()data.default net.solarnetwork.domain.BasicDeviceInfo.BuilderGet aBasicDeviceInfobuilder, populated fromgetDeviceInfo().static net.solarnetwork.domain.BasicDeviceInfo.BuilderdeviceInfoBuilderForInfo(Map<String, ?> info) Get aBasicDeviceInfobuilder, populated from an info map, using theINFO_*keys defined on this interface.Gets the time stamp of the data.Get descriptive information about the device the data was captured from.
-
Field Details
-
INFO_KEY_DEVICE_NAME
Key for the name, as a String.- See Also:
-
INFO_KEY_DEVICE_MODEL
Key for the model, as a String.- See Also:
-
INFO_KEY_DEVICE_SERIAL_NUMBER
Key for the serial number, as a Long.- See Also:
-
INFO_KEY_DEVICE_MANUFACTURER
Key for the manufacturer, as a String.- See Also:
-
INFO_KEY_DEVICE_MANUFACTURE_DATE
Key for the manufacture date, as aLocalDate.- See Also:
-
INFO_KEY_DEVICE_VERSION
Key for the version (e.g. firmware), as a String.- See Also:
-
-
Method Details
-
getDataTimestamp
Instant getDataTimestamp()Gets the time stamp of the data.- Returns:
- the data time stamp, or null if no data has been collected yet
-
getDeviceInfo
Get descriptive information about the device the data was captured from.The various INFO_* constants defined on this interface provide some standardized keys to use in the returned map.
- Returns:
- a map of device information, never null
-
deviceInfo
default net.solarnetwork.domain.DeviceInfo deviceInfo()Get aDeviceInfoinstance based on thegetDeviceInfo()data.- Returns:
- the device info, or null if no device properties are available
- Since:
- 1.1
-
deviceInfoBuilder
default net.solarnetwork.domain.BasicDeviceInfo.Builder deviceInfoBuilder()Get aBasicDeviceInfobuilder, populated fromgetDeviceInfo().- Returns:
- the builder, never null
- Since:
- 1.1
-
deviceInfoBuilderForInfo
Get aBasicDeviceInfobuilder, populated from an info map, using theINFO_*keys defined on this interface.- Parameters:
info- the info to extract device properties from- Returns:
- the builder, never null
-