public class Attribute
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
Attribute.DataType
An enum denoting the data type of the given attribute's values.
|
Modifier | Constructor and Description |
---|---|
protected |
Attribute(int id,
Capability parent)
The constructor of the current class.
|
Modifier and Type | Method and Description |
---|---|
int |
getArrayLength()
This function can be used to get the length of the array IF AND ONLY IF THE CURRENT
dataType is an array. |
java.lang.Boolean |
getAsBoolean() |
boolean[] |
getAsBooleanArr()
A function with a job to narrow the
currentValue
to boolean[] explicitly. |
java.lang.Number |
getAsNumber() |
java.lang.Number[] |
getAsNumberArr()
A function with a job to narrow the
currentValue
to Number[] explicitly. |
java.lang.String |
getAsString() |
java.lang.String[] |
getAsStringArr()
A function with a job to narrow the
currentValue
to String[] explicitly. |
java.lang.Object |
getCurrentValue()
This function can be used to get the current value that the attribute can take.
|
Attribute.DataType |
getDataType()
This function can be used to get the dataType of the attribute.
|
java.lang.Object |
getDefaultValue()
This function can be used to get the default value that the attribute can take.
|
java.lang.String |
getDescription()
This function is used to get the description of the attribute.
|
<T> T |
getElement(int position)
A function to help with getting the items of the current value NOTE: Works only when
dataType is an array. |
Capability.AttributeId |
getId()
This function is used to get the AttributeId enum of the Attribute.
|
int |
getMapKey()
This function is used to get the integer Ids of the Attribute.
|
long |
getMaxReportingInterval()
This function is used to get the maxReporting time of an attribute.
|
java.lang.Object |
getMaxValue()
This function can be used to get the max value that the attribute can take.
|
long |
getMinReportingInterval()
This function is used to get the minReporting time of an attribute.
|
java.lang.Object |
getMinValue()
This function can be used to get the min value that the attribute can take.
|
java.lang.String |
getName()
This function is used to get the name of the attribute.
|
Capability |
getParent()
This function can be used to get the parent capability of the attribute.
|
int |
hashCode() |
protected void |
internalMarkAsReady() |
protected void |
internalSetArrayLength(int arrayLength) |
protected void |
internalSetCurrentValue(java.lang.Object currentValue) |
protected void |
internalSetDataType(int dataType) |
protected void |
internalSetDefaultValue(java.lang.Object defaultValue) |
protected void |
internalSetDescription(java.lang.String description) |
protected void |
internalSetMaxReportingInterval(long maxReportingInterval) |
protected void |
internalSetMaxValue(java.lang.Object maxValue) |
protected void |
internalSetMinReportingInterval(long minReportingInterval) |
protected void |
internalSetMinValue(java.lang.Object minValue) |
protected void |
internalSetName(java.lang.String name) |
protected void |
internalSetParent(Capability parent) |
protected void |
internalSetRealtimeUpdate(boolean isRealTimeUpdate) |
boolean |
isBooleanValue() |
boolean |
isNumberValue() |
boolean |
isReady()
A function to state if the current attribute is made from callbacks or state retrieval.
|
boolean |
isRealTimeUpdate() |
boolean |
isStringValue() |
java.lang.String |
toString() |
protected Attribute(int id, Capability parent)
id
- The unique Id of the attribute.parent
- The parent capability of the attributepublic final int getMapKey()
public final Capability.AttributeId getId()
public java.lang.String getName()
public java.lang.String getDescription()
public Attribute.DataType getDataType()
public java.lang.Object getMinValue()
public java.lang.Object getMaxValue()
public java.lang.Object getDefaultValue()
getDataType()
.public java.lang.Object getCurrentValue()
public Capability getParent()
public long getMaxReportingInterval()
public long getMinReportingInterval()
public int getArrayLength()
dataType
is an array.public <T> T getElement(int position)
dataType
is an array.position
- The position of the item.public final boolean isRealTimeUpdate()
protected final void internalSetRealtimeUpdate(boolean isRealTimeUpdate)
protected void internalSetName(java.lang.String name)
protected void internalSetDescription(java.lang.String description)
protected void internalSetDataType(int dataType)
protected void internalSetArrayLength(int arrayLength)
protected void internalSetMinValue(java.lang.Object minValue)
protected void internalSetMaxValue(java.lang.Object maxValue)
protected void internalSetCurrentValue(java.lang.Object currentValue)
protected void internalSetDefaultValue(java.lang.Object defaultValue)
protected void internalSetMinReportingInterval(long minReportingInterval)
protected void internalSetMaxReportingInterval(long maxReportingInterval)
protected void internalMarkAsReady()
public java.lang.String getAsString()
public boolean isStringValue()
public java.lang.Number getAsNumber()
public boolean isNumberValue()
public boolean isBooleanValue()
public java.lang.Boolean getAsBoolean()
public java.lang.Number[] getAsNumberArr()
currentValue
to Number[] explicitly.
NOTE: works only when dataType
is int[], long[], float[] or double[]public boolean[] getAsBooleanArr()
currentValue
to boolean[] explicitly.public java.lang.String[] getAsStringArr()
currentValue
to String[] explicitly.protected void internalSetParent(Capability parent)
public java.lang.String toString()
toString
in class java.lang.Object
public boolean isReady()
public final int hashCode()
hashCode
in class java.lang.Object