public abstract class Capability extends Object
Modifier and Type | Class and Description |
---|---|
static class |
Capability.ValidValues
Represents a value validator.
|
static class |
Capability.ValidValuesFlag
Flag based value validator.
|
static class |
Capability.ValidValuesList
Listed based value validator.
|
static class |
Capability.ValidValuesRange
Represents a range based value validator.
|
Modifier and Type | Method and Description |
---|---|
Object |
getCurrentValue()
The current value returned from the device
|
Long |
getCurrentValueAsLong()
Returns the current value as long or null if it is null
|
String |
getCurrentValueAsString()
Returns the current value as string or null if it is null
|
String |
getDescription() |
long |
getFlags()
Access and permission flags.
|
long |
getId()
The id of the capability
|
String |
getName()
Name of the capability.
|
Object |
getNewValue()
New value to be set to the device.
|
long |
getType()
Data type.
|
Capability.ValidValues |
getValidValues()
Value validator if available
|
Object |
getValue()
Returns the new value if it has been set otherwise the current value.
|
Long |
getValueAsLong()
Returns the new value if it has been set otherwise the current value.
|
String |
getValueAsString()
Returns the new value if it has been set, current value otherwise.
|
boolean |
hasNewValue()
Whether new value has been set.
|
boolean |
isForceSet()
Whether value should be write to the device even it is the same as the getCurrentValue() .
|
boolean |
isThrowExceptionIfSetFailed()
Whether an exception should be thrown when failing to set the new value.
|
abstract boolean |
isWritable()
Whether this capability allows the end user to set.
|
boolean |
needToWriteToDevice()
Whether the new value will be actually sent to the device before scanning.
|
void |
setForceSet(boolean forceSet)
Whether value should be write to the device even it is the same as the getCurrentValue() .
|
void |
setNewValue(Object newValue)
New value to be set to the device.
|
void |
setThrowExceptionIfSetFailed(boolean throwExceptionIfSetFailed)
Whether an exception should be thrown when failing to set the new value.
|
void |
unset()
Clears the new value that has been set.
|
void |
update(Capability latest)
Updates information from the latest retrieval.
|
public void update(Capability latest)
latest
- target to copy frompublic long getId()
public String getName()
public String getDescription()
public long getType()
public long getFlags()
public Capability.ValidValues getValidValues()
public Object getCurrentValue()
public String getCurrentValueAsString()
public Long getCurrentValueAsLong()
NumberFormatException
- if the current value can not be converted to a numberpublic abstract boolean isWritable()
public boolean hasNewValue()
public void unset()
public Object getNewValue()
public void setNewValue(Object newValue)
public Object getValue()
public String getValueAsString()
public Long getValueAsLong()
NumberFormatException
- if the current value can not be converted to a numberpublic boolean isForceSet()
public void setForceSet(boolean forceSet)
public boolean needToWriteToDevice()
public boolean isThrowExceptionIfSetFailed()
public void setThrowExceptionIfSetFailed(boolean throwExceptionIfSetFailed)
throwExceptionIfSetFailed
- Copyright © 2014 LAB Asprise. All Rights Reserved.