Package com.thingworx.types.primitives
Class ThingCodePrimitive
java.lang.Object
com.thingworx.types.primitives.ThingCodePrimitive
- All Implemented Interfaces:
IPrimitiveType<ThingCodePrimitive,
,ThingCode> Serializable
,Cloneable
,Comparable
,Comparator<ThingCodePrimitive>
@ThingworxExtensionApiClass(since={7,1},
canInstantiate=true)
public final class ThingCodePrimitive
extends Object
implements IPrimitiveType<ThingCodePrimitive,ThingCode>, Cloneable
Primitive type used to encapsulate a ThingCode.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescription
Construct a new ThingCodePrimitive with a new ThingCode containing null values.ThingCodePrimitive
(ThingCode thingCode)
Construct a new ThingCodePrimitive with a provided ThingCode.ThingCodePrimitive
(Integer domainId, Long instanceId)
Construct a new ThingCodePrimitive with the provided domainId and instanceId. -
Method Summary
Modifier and TypeMethodDescriptionclone()
Clone the current ThingCodePrimitive instance.int
int
static ThingCodePrimitive
convertFromObject
(Object data)
Convert the incoming data Object to a ThingCodePrimitive from a String, ThingCode, JSONObject, or HashMap.
Get the BaseType associated to this ThingCodePrimitive.getValue()
Get this ThingCodePrimitive instance value.void
toString()
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.Comparator
equals, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
-
Constructor Details
-
ThingCodePrimitive
Construct a new ThingCodePrimitive with a new ThingCode containing null values. -
ThingCodePrimitive
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(Integer domainId, 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 Details
-
getBaseType
Get the BaseType associated to this ThingCodePrimitive.- Specified by:
getBaseType
in interfaceIPrimitiveType<ThingCodePrimitive,
ThingCode>
-
getSerializedValue
- Specified by:
getSerializedValue
in interfaceIPrimitiveType<ThingCodePrimitive,
ThingCode> - Throws:
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
Get this ThingCodePrimitive instance value.- Specified by:
getValue
in interfaceIPrimitiveType<ThingCodePrimitive,
ThingCode> - Returns:
- This ThingCodePrimitive's value
-
compareTo
- Specified by:
compareTo
in interfaceComparable
-
compare
@ThingworxExtensionApiMethod(since={7,1}) public int compare(ThingCodePrimitive v1, ThingCodePrimitive v2) - Specified by:
compare
in interfaceComparator<ThingCodePrimitive>
-
toString
-
clone
Clone the current ThingCodePrimitive instance.- Specified by:
clone
in interfaceIPrimitiveType<ThingCodePrimitive,
ThingCode> - Overrides:
clone
in classObject
-
convertFromObject
@ThingworxExtensionApiMethod(since={7,1}) public static ThingCodePrimitive convertFromObject(Object data) throws 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:
Exception
- if an error occurs
-
getStringValue
- Specified by:
getStringValue
in interfaceIPrimitiveType<ThingCodePrimitive,
ThingCode>
-
setValue
- Specified by:
setValue
in interfaceIPrimitiveType<ThingCodePrimitive,
ThingCode>
-