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 Details

    • INFO_KEY_DEVICE_NAME

      static final String INFO_KEY_DEVICE_NAME
      Key for the name, as a String.
      See Also:
    • INFO_KEY_DEVICE_MODEL

      static final String INFO_KEY_DEVICE_MODEL
      Key for the model, as a String.
      See Also:
    • INFO_KEY_DEVICE_SERIAL_NUMBER

      static final String INFO_KEY_DEVICE_SERIAL_NUMBER
      Key for the serial number, as a Long.
      See Also:
    • INFO_KEY_DEVICE_MANUFACTURER

      static final String INFO_KEY_DEVICE_MANUFACTURER
      Key for the manufacturer, as a String.
      See Also:
    • INFO_KEY_DEVICE_MANUFACTURE_DATE

      static final String INFO_KEY_DEVICE_MANUFACTURE_DATE
      Key for the manufacture date, as a LocalDate.
      See Also:
    • INFO_KEY_DEVICE_VERSION

      static final String 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

      Map<String,Object> 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 a DeviceInfo instance based on the getDeviceInfo() 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 a BasicDeviceInfo builder, populated from getDeviceInfo().
      Returns:
      the builder, never null
      Since:
      1.1
    • deviceInfoBuilderForInfo

      static net.solarnetwork.domain.BasicDeviceInfo.Builder deviceInfoBuilderForInfo(Map<String,?> info)
      Get a BasicDeviceInfo builder, populated from an info map, using the INFO_* keys defined on this interface.
      Parameters:
      info - the info to extract device properties from
      Returns:
      the builder, never null