Package com.thingworx.types.primitives
Class ThingCodePrimitive
- java.lang.Object
-
- com.thingworx.types.primitives.ThingCodePrimitive
-
- All Implemented Interfaces:
IPrimitiveType<ThingCodePrimitive,ThingCode>
,java.io.Serializable
,java.lang.Cloneable
,java.lang.Comparable
,java.util.Comparator<ThingCodePrimitive>
@ThingworxExtensionApiClass(since={7,1}, canInstantiate=true) public final class ThingCodePrimitive extends java.lang.Object implements IPrimitiveType<ThingCodePrimitive,ThingCode>, java.lang.Cloneable
Primitive type used to encapsulate a ThingCode.- See Also:
ThingCode
, Serialized Form
-
-
Constructor Summary
Constructors Constructor Description ThingCodePrimitive()
Construct a new ThingCodePrimitive with a new ThingCode containing null values.ThingCodePrimitive(ThingCode thingCode)
Construct a new ThingCodePrimitive with a provided ThingCode.ThingCodePrimitive(java.lang.Integer domainId, java.lang.Long instanceId)
Construct a new ThingCodePrimitive with the provided domainId and instanceId.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description ThingCodePrimitive
clone()
Clone the current ThingCodePrimitive instance.int
compare(ThingCodePrimitive v1, ThingCodePrimitive v2)
int
compareTo(java.lang.Object value)
static ThingCodePrimitive
convertFromObject(java.lang.Object data)
Convert the incoming data Object to a ThingCodePrimitive from a String, ThingCode, JSONObject, or HashMap.BaseTypes
getBaseType()
Get the BaseType associated to this ThingCodePrimitive.java.lang.Object
getSerializedValue()
java.lang.String
getStringValue()
ThingCode
getValue()
Get this ThingCodePrimitive instance value.void
setValue(ThingCode value)
java.lang.String
toString()
-
-
-
Constructor Detail
-
ThingCodePrimitive
@ThingworxExtensionApiMethod(since={7,1}) public ThingCodePrimitive()
Construct a new ThingCodePrimitive with a new ThingCode containing null values.
-
ThingCodePrimitive
@ThingworxExtensionApiMethod(since={7,1}) public ThingCodePrimitive(ThingCode thingCode)
Construct a new ThingCodePrimitive with a provided ThingCode.- Parameters:
thingCode
- - A ThingCode to be stored into a new ThingCodePrimitive
-
ThingCodePrimitive
@ThingworxExtensionApiMethod(since={7,1}) public ThingCodePrimitive(java.lang.Integer domainId, java.lang.Long instanceId)
Construct a new ThingCodePrimitive with the provided domainId and instanceId. SeeThingCode
for details of the domainId and instanceId.- Parameters:
domainId
- - numerical ID that represents an organization or sub-unitinstanceId
- - numerical ID that represents a unique Thing
-
-
Method Detail
-
getBaseType
@ThingworxExtensionApiMethod(since={7,1}) public BaseTypes getBaseType()
Get the BaseType associated to this ThingCodePrimitive.- Specified by:
getBaseType
in interfaceIPrimitiveType<ThingCodePrimitive,ThingCode>
-
getSerializedValue
@ThingworxExtensionApiMethod(since={7,1}) public java.lang.Object getSerializedValue() throws java.lang.Exception
- Specified by:
getSerializedValue
in interfaceIPrimitiveType<ThingCodePrimitive,ThingCode>
- Throws:
java.lang.Exception
- If an error occurs
Get a serialized String representation of this ThingCodePrimitive instance. Will return null if this ThingCodePrimitive's ThingCode is null.
-
getValue
@ThingworxExtensionApiMethod(since={7,1}) public ThingCode getValue()
Get this ThingCodePrimitive instance value.- Specified by:
getValue
in interfaceIPrimitiveType<ThingCodePrimitive,ThingCode>
- Returns:
- This ThingCodePrimitive's value
-
compareTo
@ThingworxExtensionApiMethod(since={7,1}) public int compareTo(java.lang.Object value)
- Specified by:
compareTo
in interfacejava.lang.Comparable
-
compare
@ThingworxExtensionApiMethod(since={7,1}) public int compare(ThingCodePrimitive v1, ThingCodePrimitive v2)
- Specified by:
compare
in interfacejava.util.Comparator<ThingCodePrimitive>
-
toString
@ThingworxExtensionApiMethod(since={7,1}) public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
clone
@ThingworxExtensionApiMethod(since={7,1}) public ThingCodePrimitive clone()
Clone the current ThingCodePrimitive instance.- Specified by:
clone
in interfaceIPrimitiveType<ThingCodePrimitive,ThingCode>
- Overrides:
clone
in classjava.lang.Object
-
convertFromObject
@ThingworxExtensionApiMethod(since={7,1}) public static ThingCodePrimitive convertFromObject(java.lang.Object data) throws java.lang.Exception
Convert the incoming data Object to a ThingCodePrimitive from a String, ThingCode, JSONObject, or HashMap.- Parameters:
data
- - Incoming object to be converted to a ThingCodePrimitive- Returns:
- A new ThingCodePrimitive
- Throws:
java.lang.Exception
- if an error occurs
-
getStringValue
@ThingworxExtensionApiMethod(since={7,1}) public java.lang.String getStringValue()
- Specified by:
getStringValue
in interfaceIPrimitiveType<ThingCodePrimitive,ThingCode>
-
setValue
@ThingworxExtensionApiMethod(since={7,1}) public void setValue(ThingCode value)
- Specified by:
setValue
in interfaceIPrimitiveType<ThingCodePrimitive,ThingCode>
-
-