public class Identifier
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
Identifier.SerializedId
A helper class for generating Identifier object using
fromSerializable(java.io.Serializable) . |
static class |
Identifier.SourceIdentifier
This class serves as a source URI in storage content metadata
StorageContentMetadata . |
static class |
Identifier.TriggerIdentifier
This class serves as an attribute in
StorageContentMetadata as upload triggered identifier. |
Modifier and Type | Field and Description |
---|---|
int |
attributeId |
int |
capabilityId |
long |
deviceNodeId |
java.lang.String |
networkId |
java.lang.String |
resourceEui |
int |
ruleId |
int |
sceneId |
int |
zoneId |
Constructor and Description |
---|
Identifier(Identifier id)
Constructor for current class.
|
Identifier(java.lang.String networkId,
long deviceNodeId,
java.lang.String resourceEui,
int capabilityId,
int attributeId,
int zoneId,
int sceneId,
int ruleId)
An overloaded constructor for current class.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object obj) |
static Identifier |
fromJson(com.google.gson.Gson gson,
java.lang.String jsonIdentifier) |
static Identifier |
fromJson(java.lang.String jsonIdentifier) |
static Identifier |
fromJsonTree(com.google.gson.Gson gson,
com.google.gson.JsonElement jsonElement) |
static Identifier |
fromJsonTree(com.google.gson.JsonElement jsonElement) |
static Identifier |
fromSerializable(java.io.Serializable serializable)
A function to make an identifier out of serializable param.
|
<T extends Attribute> |
getAttribute()
A generic method to fetch attribute for the identifier instance.
|
<T extends Capability> |
getCapability()
A generic method to fetch capability for the identifier instance.
|
<T extends Device> |
getDevice()
A generic method to fetch device for the identifier instance.
|
static Identifier |
getIdentifier(Attribute attribute)
A function to get all identification information for attribute param.
|
static Identifier |
getIdentifier(Capability capability)
A function to get all identification information for capability param.
|
static Identifier |
getIdentifier(Device device)
A function to get all identification information for device param.
|
static Identifier |
getIdentifier(Network network)
A function to get all identification information for device param.
|
static Identifier |
getIdentifier(Resource resource)
A function to get all identification information for resource param.
|
static Identifier |
getIdentifier(Rule rule)
A function to get all identification information for rule param.
|
static Identifier |
getIdentifier(Scene scene)
A function to get all identification information for scene param.
|
static Identifier |
getIdentifier(Zone zone)
A function to get all identification information for zone param.
|
<T extends Network> |
getNetwork()
A generic method to fetch network for the identifier instance.
|
<T extends Resource> |
getResource()
A generic method to fetch Resource for the identifier instance.
|
<T extends Rule> |
getRule()
A generic method to fetch rule for the identifier instance.
|
<T extends Scene> |
getScene()
A generic method to fetch scene for the identifier instance.
|
<T extends Zone> |
getZone()
A generic method to fetch zone for the identifier instance.
|
int |
hashCode() |
java.lang.String |
toJson() |
java.lang.String |
toJson(com.google.gson.Gson gson) |
com.google.gson.JsonElement |
toJsonTree() |
com.google.gson.JsonElement |
toJsonTree(com.google.gson.Gson gson) |
java.io.Serializable |
toSerializable() |
java.lang.String |
toString() |
@SerializedName(value="networkId") public final java.lang.String networkId
@SerializedName(value="nodeId", alternate="gatewayNodeId") public final long deviceNodeId
@SerializedName(value="resourceEui") public final java.lang.String resourceEui
@SerializedName(value="capabilityId") public final int capabilityId
@SerializedName(value="attributeId") public final int attributeId
@SerializedName(value="zoneId") public final int zoneId
@SerializedName(value="sceneId") public final int sceneId
@SerializedName(value="ruleId") public final int ruleId
public Identifier(Identifier id)
id
- identifier with information of all ids.public Identifier(java.lang.String networkId, long deviceNodeId, java.lang.String resourceEui, int capabilityId, int attributeId, int zoneId, int sceneId, int ruleId)
networkId
- The network to which the device belongs will responddeviceNodeId
- The device which has to respond to this requestresourceEui
- The ID corresponding to the resourcecapabilityId
- CapabilityID of the recipient resourceattributeId
- ID of the attribute value as in Capability.AttributeId
zoneId
- ID of the zone in the networksceneId
- ID of the scene created by user in networkruleId
- ID of the rule created by user in networkpublic static Identifier getIdentifier(Network network)
network
- Network object in interest, for an Identifierpublic static Identifier getIdentifier(Device device)
device
- Device object in interest, for an Identifierpublic static Identifier getIdentifier(Resource resource)
resource
- Resource object in interest, for an Identifierpublic static Identifier getIdentifier(Capability capability)
capability
- Capability object in interest, for an Identifierpublic static Identifier getIdentifier(Attribute attribute)
attribute
- Attribute object in interest, for an Identifierpublic static Identifier getIdentifier(Zone zone)
zone
- Zone object in interest, for an Identifierpublic static Identifier getIdentifier(Scene scene)
scene
- Scene object in interest, for an Identifierpublic static Identifier getIdentifier(Rule rule)
rule
- Rule object in interest, for an Identifierpublic <T extends Network> T getNetwork()
T
- any immediate subclass of Network classpublic <T extends Device> T getDevice()
T
- any immediate subclass of Device classpublic <T extends Resource> T getResource()
T
- any immediate subclass of Resource classpublic <T extends Capability> T getCapability()
T
- any immediate subclass of Capability classpublic <T extends Attribute> T getAttribute()
T
- any immediate subclass of Attribute classpublic <T extends Zone> T getZone()
T
- any immediate subclass of Zone classpublic <T extends Scene> T getScene()
T
- any immediate subclass of Scene classpublic <T extends Rule> T getRule()
T
- any immediate subclass of Rule classpublic boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public com.google.gson.JsonElement toJsonTree()
public com.google.gson.JsonElement toJsonTree(com.google.gson.Gson gson)
public java.lang.String toJson()
public java.lang.String toJson(com.google.gson.Gson gson)
public java.io.Serializable toSerializable()
public static Identifier fromSerializable(java.io.Serializable serializable)
serializable
- Serializable instance in interest, for an Identifier instancepublic static Identifier fromJson(java.lang.String jsonIdentifier)
public static Identifier fromJson(com.google.gson.Gson gson, java.lang.String jsonIdentifier)
public static Identifier fromJsonTree(com.google.gson.JsonElement jsonElement)
public static Identifier fromJsonTree(com.google.gson.Gson gson, com.google.gson.JsonElement jsonElement)
public java.lang.String toString()
toString
in class java.lang.Object