public final class BasicDeviceConfig extends BasicElementConfig<DeviceId>
Config.FieldPresence
GRID_X, GRID_Y, LATITUDE, LOC_TYPE, LOC_TYPE_GEO, LOC_TYPE_GRID, LOC_TYPE_NONE, LONGITUDE, NAME, OWNER, RACK_ADDRESS, ROLES, UI_TYPE, ZERO_THRESHOLD
ALLOWED
Constructor and Description |
---|
BasicDeviceConfig() |
Modifier and Type | Method and Description |
---|---|
DeviceKeyId |
deviceKeyId()
Returns the device key id.
|
BasicDeviceConfig |
deviceKeyId(DeviceKeyId deviceKeyId)
Sets the device key id.
|
String |
driver()
Returns the device driver name.
|
BasicDeviceConfig |
driver(String driverName)
Sets the driver name.
|
String |
hwVersion()
Returns the device hardware version.
|
BasicDeviceConfig |
hwVersion(String hwVersion)
Sets the device hardware version.
|
boolean |
isValid()
Indicates whether or not the backing JSON node contains valid data.
|
String |
managementAddress()
Returns the device management ip (ip:port).
|
BasicDeviceConfig |
managementAddress(String managementAddress)
Sets the device management ip (ip:port).
|
String |
manufacturer()
Returns the device manufacturer.
|
BasicDeviceConfig |
manufacturer(String manufacturerName)
Sets the device manufacturer.
|
String |
serial()
Returns the device serial number.
|
BasicDeviceConfig |
serial(String serial)
Sets the device serial number.
|
String |
swVersion()
Returns the device software version.
|
BasicDeviceConfig |
swVersion(String swVersion)
Sets the device software version.
|
Device.Type |
type()
Returns the device type.
|
BasicDeviceConfig |
type(Device.Type type)
Sets the device type.
|
geoCoordsSet, gridCoordsSet, gridX, gridX, gridY, gridY, latitude, latitude, locType, locType, longitude, longitude, name, name, owner, owner, rackAddress, rackAddress, roles, roles, uiType, uiType
isAllowed, isAllowed
apply, clear, get, get, get, get, get, get, getList, getList, hasField, hasField, hasFields, hasFields, hasOnlyFields, hasOnlyFields, init, isBoolean, isBoolean, isConnectPoint, isConnectPoint, isDecimal, isDecimal, isIntegralNumber, isIntegralNumber, isIpAddress, isIpAddress, isIpPrefix, isIpPrefix, isMacAddress, isMacAddress, isNumber, isNumber, isString, isString, isTpPort, isTpPort, isValidLength, key, node, setList, setOrClear, setOrClear, setOrClear, setOrClear, setOrClear, setOrClear, setOrClear, subject, toString
public boolean isValid()
Config
Default implementation returns true. Subclasses are expected to override this with their own validation. Implementations are free to throw a RuntimeException if data is invalid.
isValid
in class BasicElementConfig<DeviceId>
public Device.Type type()
public BasicDeviceConfig type(Device.Type type)
type
- device type overridepublic String driver()
public BasicDeviceConfig driver(String driverName)
driverName
- new driver name; null to clearpublic String manufacturer()
public BasicDeviceConfig manufacturer(String manufacturerName)
manufacturerName
- new manufacturer; null to clearpublic String hwVersion()
public BasicDeviceConfig hwVersion(String hwVersion)
hwVersion
- new hardware version; null to clearpublic String swVersion()
public BasicDeviceConfig swVersion(String swVersion)
swVersion
- new software version; null to clearpublic String serial()
public BasicDeviceConfig serial(String serial)
serial
- new serial number; null to clearpublic String managementAddress()
public BasicDeviceConfig managementAddress(String managementAddress)
managementAddress
- new device management address (ip:port); null to clearpublic DeviceKeyId deviceKeyId()
public BasicDeviceConfig deviceKeyId(DeviceKeyId deviceKeyId)
deviceKeyId
- the new device key id; null to clear