public class Resource extends java.lang.Object implements java.lang.Iterable<Capability>
Modifier | Constructor and Description |
---|---|
protected |
Resource(java.lang.String eui,
Device parentDevice,
Zone parentZone)
The constructor is protected.
|
Modifier and Type | Method and Description |
---|---|
boolean |
containsCapability(Capability.CapabilityId capabilityId)
This function assists in checking membership of capability in capability map.
|
<T extends Attribute> |
getAttribute(Capability.AttributeId attrId)
This function is used to return the capability with the given .
|
<T extends Capability> |
getCapability(Capability.CapabilityId capId)
This function is used to return the capability with the given capabilityId.
|
java.util.Map<Capability.CapabilityId,Capability> |
getCapabilityMap()
This function is used to return the HashMap that the sdk uses to map
the CapabilityId to the Capability Objects.
|
java.lang.String |
getFirmware()
This function is used to get the firmware version of the current resource.
|
java.lang.String |
getId()
This function is used to get the unique Id of the resource.
|
java.lang.String |
getManufacturer()
This function is used to get the manufacturer name of the resource.
|
java.lang.String |
getMetadata()
A function to get the metadata of the resource.
|
java.lang.String |
getModel()
This function is used to get the model name of the resource.
|
java.lang.String |
getName()
This function is used to get the name of the resource.
|
<T extends Device> |
getParent()
This function is used to get the Parent device of the resource.
|
<T extends Zone> |
getParentZone()
This function is used to get the Parent zone of the resource.
|
PowerSource |
getPowerSource()
This function is used to know how the resource is being powered.
|
RadioProtocol |
getProtocol() |
ReceiverType |
getReceiverType()
This function is used to get the receiver properties of the resource.
|
int |
hashCode() |
protected void |
internalAddCapability(Capability capability) |
protected void |
internalMarkAsReady() |
protected void |
internalRemoveCapability(Capability.CapabilityId capabilityId) |
protected void |
internalRemoveResource() |
protected void |
internalSetFirmware(java.lang.String firmware) |
protected void |
internalSetManufacturer(java.lang.String manufacturer) |
protected void |
internalSetMetadata(java.lang.String metadata) |
protected void |
internalSetModel(java.lang.String model) |
protected void |
internalSetName(java.lang.String name) |
protected void |
internalSetParentDevice(Device parentDevice) |
protected void |
internalSetParentZone(Zone parentZone) |
protected void |
internalSetPowerSource(PowerSource powerSource) |
protected void |
internalSetProtocol(RadioProtocol protocol) |
protected void |
internalSetReceiverType(ReceiverType receiverType) |
boolean |
isReady()
A function to suggest if the current resource is dummy or not.
|
java.util.Iterator<Capability> |
iterator() |
void |
setMetadata(java.lang.String metadata,
Device.DeviceManagementStatusListener listener)
A function to set the name of the current resource.
|
void |
setName(java.lang.String name,
Device.DeviceManagementStatusListener listener)
A function to set the name of the current resource.
|
java.lang.String |
toString() |
public final java.lang.String getId()
public java.lang.String getName()
public void setName(java.lang.String name, Device.DeviceManagementStatusListener listener)
name
- The name which has to be set.listener
- The listener that will be triggered with callbacks.public java.lang.String getManufacturer()
public java.lang.String getModel()
public java.lang.String getFirmware()
public PowerSource getPowerSource()
public ReceiverType getReceiverType()
public final <T extends Device> T getParent()
public final <T extends Zone> T getParentZone()
public java.lang.String getMetadata()
public void setMetadata(java.lang.String metadata, Device.DeviceManagementStatusListener listener)
metadata
- The data which has to be stored.listener
- The listener that will be triggered with callbacks.public java.util.Map<Capability.CapabilityId,Capability> getCapabilityMap()
public <T extends Capability> T getCapability(Capability.CapabilityId capId)
public <T extends Attribute> T getAttribute(Capability.AttributeId attrId)
public boolean containsCapability(Capability.CapabilityId capabilityId)
capabilityId
- identifier of the Capabilityprotected void internalAddCapability(Capability capability)
protected void internalRemoveCapability(Capability.CapabilityId capabilityId)
public boolean isReady()
protected void internalSetName(java.lang.String name)
protected void internalSetMetadata(java.lang.String metadata)
protected void internalSetManufacturer(java.lang.String manufacturer)
protected void internalSetModel(java.lang.String model)
protected void internalSetFirmware(java.lang.String firmware)
protected void internalSetPowerSource(PowerSource powerSource)
protected void internalSetReceiverType(ReceiverType receiverType)
protected void internalSetParentDevice(Device parentDevice)
protected void internalSetParentZone(Zone parentZone)
protected void internalMarkAsReady()
protected void internalSetProtocol(RadioProtocol protocol)
protected void internalRemoveResource()
public RadioProtocol getProtocol()
public final int hashCode()
hashCode
in class java.lang.Object
public java.util.Iterator<Capability> iterator()
iterator
in interface java.lang.Iterable<Capability>
public java.lang.String toString()
toString
in class java.lang.Object