@ThingworxExtensionApiClass(since={7,1}, canInstantiate=true) public class ThingCode extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
DOMAIN_ID |
static java.lang.String |
INSTANCE_ID |
Constructor and Description |
---|
ThingCode()
Construct a new ThingCode with null values for domainId and instanceId. |
ThingCode(java.lang.Integer domainId,
java.lang.Long instanceId)
Construct a new ThingCode with the provided domainId and instanceId. |
Modifier and Type | Method and Description |
---|---|
int |
compare(ThingCode v1,
ThingCode v2) |
int |
compareTo(java.lang.Object value) |
static ThingCode |
fromJSON(org.json.JSONObject props)
Construct a ThingCode from a JSONObject by performing a lookup for "domainId" and "instanceId". |
static ThingCode |
fromMap(java.util.Map<java.lang.String,java.lang.Object> props)
Construct a ThingCode from a HashMap by performing a lookup for "domainId" and "instanceId". |
static ThingCode |
fromString(java.lang.String value)
Construct a new ThingCode from a String by splitting the incoming string by ':' then parsing the first string value for domainId and the second string result for instanceId. |
java.lang.Integer |
getDomainId()
Get the domain ID of the ThingCode. |
java.lang.Long |
getInstanceId()
Get the instanceId of the ThingCode. |
boolean |
isDefaultValue()
Checks if the ThingCode instance is in its default state. |
void |
setDomainId(java.lang.Integer domainId)
Set the domainId of the ThingCode. |
void |
setInstanceId(java.lang.Long instanceId)
Set the instanceId of the ThingCode. |
org.json.JSONObject |
toJSON()
Construct a new JSONObject from this ThingCode instance. |
java.util.Map<java.lang.String,java.lang.Object> |
toMap()
Construct a new HashMap from this ThingCode instance. |
java.lang.String |
toString()
Construct a String representation of this ThingCode instance. |
public static final java.lang.String DOMAIN_ID
public static final java.lang.String INSTANCE_ID
@ThingworxExtensionApiMethod(since={7,1}) public ThingCode()
@ThingworxExtensionApiMethod(since={7,1}) public ThingCode(java.lang.Integer domainId, java.lang.Long instanceId)
domainId
- - numerical ID that represents an organization or sub-unitinstanceId
- - numerical ID that represents a unique Thing@ThingworxExtensionApiMethod(since={7,1}) public java.lang.Integer getDomainId()
@ThingworxExtensionApiMethod(since={7,1}) public void setDomainId(java.lang.Integer domainId)
domainId
- - numerical ID that represents an organization or sub-unit@ThingworxExtensionApiMethod(since={7,1}) public java.lang.Long getInstanceId()
@ThingworxExtensionApiMethod(since={7,1}) public void setInstanceId(java.lang.Long instanceId)
instanceId
- - numerical ID that represents a unique Thing@ThingworxExtensionApiMethod(since={7,1}) public int compareTo(java.lang.Object value)
@ThingworxExtensionApiMethod(since={7,1}) public int compare(ThingCode v1, ThingCode v2)
@ThingworxExtensionApiMethod(since={7,1}) public static ThingCode fromMap(java.util.Map<java.lang.String,java.lang.Object> props)
props
- - HashMap of data@ThingworxExtensionApiMethod(since={7,1}) public static ThingCode fromJSON(org.json.JSONObject props)
props
- - JSONObject of data@ThingworxExtensionApiMethod(since={7,1}) public java.util.Map<java.lang.String,java.lang.Object> toMap()
@ThingworxExtensionApiMethod(since={7,1}) public org.json.JSONObject toJSON()
@ThingworxExtensionApiMethod(since={7,1}) public java.lang.String toString()
toString
in class java.lang.Object
@ThingworxExtensionApiMethod(since={7,1}) public boolean isDefaultValue()
@ThingworxExtensionApiMethod(since={7,1}) public static ThingCode fromString(java.lang.String value)
value
- - String to be parsed