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