Package net.solarnetwork.domain
Class DeviceOperatingStatus<C extends Bitmaskable>
java.lang.Object
net.solarnetwork.domain.DeviceOperatingStatus<C>
- Direct Known Subclasses:
GenericDeviceOperatingStatus
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
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classBuilder to buildDeviceOperatingStatus.static final classDeviceOperatingStatus.EnumBuilder<C extends Enum<C> & Bitmaskable>Builder to buildDeviceOperatingStatususing an enum of device state values. -
Constructor Summary
ConstructorsConstructorDescriptionConstructor.DeviceOperatingStatus(DeviceOperatingState state, Set<C> deviceStates) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionbuilder()Creates builder to buildGenericDeviceOperatingStatus.static <C extends Enum<C> & Bitmaskable>
DeviceOperatingStatus.EnumBuilder<C>enumBuilder(Class<C> clazz) Creates builder to buildDeviceOperatingStatususing an enum for device state values.Get the device states.intGet the device states bitmask value.getState()Get the device operating state.intGet the device operating state code value.
-
Constructor Details
-
DeviceOperatingStatus
Constructor.The
deviceStatesproperty will be set to null.- Parameters:
state- the state
-
DeviceOperatingStatus
Constructor.- Parameters:
state- the statedeviceStates- device specific states (null allowed)
-
-
Method Details
-
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
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
Creates builder to buildGenericDeviceOperatingStatus.- Returns:
- created builder
-
enumBuilder
public static <C extends Enum<C> & Bitmaskable> DeviceOperatingStatus.EnumBuilder<C> enumBuilder(Class<C> clazz) Creates builder to buildDeviceOperatingStatususing an enum for device state values.- Type Parameters:
C- the enum type- Parameters:
clazz- the enum type class- Returns:
- created builder
-