public class Attribute
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static class |
Attribute.ApplianceInfo
Blue print for value of
CapabilityRemoteControl.AttributeId.APPLIANCE_LIST. |
static class |
Attribute.ApplianceInfoContainer
Container class for
Attribute.ApplianceInfo. |
static class |
Attribute.CapabilityAttributes
Class that describes the a attribute of capability of an appliance.
|
static class |
Attribute.CapabilityCommands
Class that describes capability and its supported commands of an appliance.
|
static class |
Attribute.DataType
An enum denoting the data type of the given attribute's values.
|
static class |
Attribute.HvacModeCurrentInfo
Class that describes current info of a mode for IR blaster / Air conditioner resource.
|
static class |
Attribute.HvacSettings
Blue print for value of
CapabilityHvacControl.AttributeId.MODE_SETTINGS. |
static class |
Attribute.ModesAttributeValue
Class that describes various settings a mode has to offer.
|
static class |
Attribute.ModesAttributeValueContainer
Class that acts as a container that can be used to serialize and deserialize the
attribute value of
CapabilityHvacControl.AttributeId.SUPPORTED_MODES_ARR. |
| 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()
A function that return the current value of this
Attribute as Boolean. |
boolean[] |
getAsBooleanArr()
A function with a job to narrow the
currentValue
to boolean[] explicitly. |
java.lang.Number |
getAsNumber()
A function to return the current value of this attribute as
Number. |
java.lang.Number[] |
getAsNumberArr()
A function with a job to narrow the
currentValue
to Number[] explicitly. |
java.lang.String |
getAsString()
A function to get current value of this attribute as
String. |
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()
A function that would be triggered by lower layers when attribute is ready.
|
protected void |
internalSetArrayLength(int arrayLength)
A function that would be triggered to update
arrayLength. |
protected void |
internalSetCurrentValue(java.lang.Object currentValue)
A function that would be triggered when attribute's
currentValue needs to be updated. |
protected void |
internalSetDataType(int dataType)
A function that would be triggered when attribute's
dataType
needs to be updated. |
protected void |
internalSetDefaultValue(java.lang.Object defaultValue)
A function that would be triggered when attribute
defaultValue needs to be updated. |
protected void |
internalSetDescription(java.lang.String description)
A function that would be triggered when attribute's
description
needs to be updated. |
protected void |
internalSetMaxReportingInterval(long maxReportingInterval)
A function that would be triggered when attribute's
maxReportingInterval
needs to be updated. |
protected void |
internalSetMaxValue(java.lang.Object maxValue)
A function that would be triggered when attribute'
maxValue needs to be updated. |
protected void |
internalSetMinReportingInterval(long minReportingInterval)
A function that would be triggered when attribute's
minReportingInterval
needs to be updated. |
protected void |
internalSetMinValue(java.lang.Object minValue)
A function that would be triggered when attribute's
minValue needs to be updated. |
protected void |
internalSetName(java.lang.String name)
A function that would be triggered when attribute name needs to be updated.
|
protected void |
internalSetParent(Capability parent)
A function that would be triggered when parent of that
attributes needs to be updated.
|
protected void |
internalSetRealtimeUpdate(boolean isRealTimeUpdate)
A function that would be triggered when attributes
isRealTimeUpdate
needs to be updated. |
boolean |
isBooleanValue()
A function to determine if the current value of the string is
Boolean. |
boolean |
isNumberValue()
A function to determine if the current value of the attribute is
Number. |
boolean |
isReady()
A function to state if the current attribute is made from callbacks or state retrieval.
|
boolean |
isRealTimeUpdate()
A function to determine if current value of this attribute is value sent by
Resource. |
boolean |
isStringValue()
A function to determine if the current value of the string is
String. |
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.T - Data type of element.position - The position of the item.public final boolean isRealTimeUpdate()
Resource.Device.protected final void internalSetRealtimeUpdate(boolean isRealTimeUpdate)
isRealTimeUpdate
needs to be updated.isRealTimeUpdate - An updated flag that represents if current value of attribute
is cached value send by Device.protected void internalSetName(java.lang.String name)
name - The updated name of the attribute.protected void internalSetDescription(java.lang.String description)
description
needs to be updated.description - The updated description of the attribute.protected void internalSetDataType(int dataType)
dataType
needs to be updated.dataType - The updated datatype of the attribute.protected void internalSetArrayLength(int arrayLength)
arrayLength.arrayLength - Length of the array.protected void internalSetMinValue(java.lang.Object minValue)
minValue needs to be updated.minValue - The updated min value of the attribute.protected void internalSetMaxValue(java.lang.Object maxValue)
maxValue needs to be updated.maxValue - The updated max value of the attribute.protected void internalSetCurrentValue(java.lang.Object currentValue)
currentValue needs to be updated.currentValue - The updated current value of the attribute.protected void internalSetDefaultValue(java.lang.Object defaultValue)
defaultValue needs to be updated.defaultValue - The updated default value of the attribute.protected void internalSetMinReportingInterval(long minReportingInterval)
minReportingInterval
needs to be updated.minReportingInterval - The updated minReportingInterval of the attribute.protected void internalSetMaxReportingInterval(long maxReportingInterval)
maxReportingInterval
needs to be updated.maxReportingInterval - The updated maxReportingInterval of the attribute.protected void internalMarkAsReady()
public java.lang.String getAsString()
String.String.public boolean isStringValue()
String.public java.lang.Number getAsNumber()
Number.Number.public boolean isNumberValue()
Number.public boolean isBooleanValue()
Boolean.public java.lang.Boolean getAsBoolean()
Attribute as Boolean.Boolean.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)
parent - Updated Capability.public java.lang.String toString()
toString in class java.lang.Objectpublic boolean isReady()
public final int hashCode()
hashCode in class java.lang.Object