Class DeviceOperatingStatus<C extends Bitmaskable>

java.lang.Object
net.solarnetwork.domain.DeviceOperatingStatus<C>
Direct Known Subclasses:
GenericDeviceOperatingStatus

public class DeviceOperatingStatus<C extends Bitmaskable> extends Object
A device operating state combined with vendor-specific states.

This class is designed to support operating states that are hardware or vendor specific and compliment the standardized states offered by DeviceOperatingState.

Since:
1.50
Version:
1.0
Author:
matt
  • Constructor Details

    • DeviceOperatingStatus

      public DeviceOperatingStatus(DeviceOperatingState state)
      Constructor.

      The deviceStates property will be set to null.

      Parameters:
      state - the state
    • DeviceOperatingStatus

      public DeviceOperatingStatus(DeviceOperatingState state, Set<C> deviceStates)
      Constructor.
      Parameters:
      state - the state
      deviceStates - device specific states (null allowed)
  • Method Details

    • getState

      public DeviceOperatingState getState()
      Get the device operating state.
      Returns:
      the state, never null
    • getStateCode

      public int getStateCode()
      Get the device operating state code value.
      Returns:
      the state code value
    • getDeviceStates

      public Set<C> getDeviceStates()
      Get the device states.
      Returns:
      the immutable device states, or null
    • getDeviceStatesCode

      public int getDeviceStatesCode()
      Get the device states bitmask value.
      Returns:
      the device states bitmask value
    • builder

      public static DeviceOperatingStatus.Builder builder()
      Creates builder to build GenericDeviceOperatingStatus.
      Returns:
      created builder
    • enumBuilder

      public static <C extends Enum<C> & Bitmaskable> DeviceOperatingStatus.EnumBuilder<C> enumBuilder(Class<C> clazz)
      Creates builder to build DeviceOperatingStatus using an enum for device state values.
      Type Parameters:
      C - the enum type
      Parameters:
      clazz - the enum type class
      Returns:
      created builder