Package com.thingworx.types.primitives
Class Vec2Primitive
java.lang.Object
com.thingworx.types.primitives.Vec2Primitive
- All Implemented Interfaces:
IPrimitiveType<Vec2Primitive,
,Vec2> Serializable
,Cloneable
,Comparable
,Comparator<Vec2Primitive>
@ThingworxExtensionApiClass(since={7,1},
canInstantiate=true)
public class Vec2Primitive
extends Object
implements IPrimitiveType<Vec2Primitive,Vec2>, Cloneable
Primitive type used to encapsulate a Vec2.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescription
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
Modifier and TypeMethodDescriptionclone()
Clone the current Vec2Primitive instance.int
compare
(Vec2Primitive v1, Vec2Primitive v2) int
static Vec2Primitive
convertFromObject
(Object data)
Convert the incoming data Object to a Vec2Primitive from a String, Vec2, JSONObject, or HashMap.
Get the BaseType associated to this Vec2Primitive.
Get a serialized String representation of this Vec2Primitive instance.getValue()
Get this Vec2Primitive's 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
-
Vec2Primitive
Construct a new Vec2Primitive with a new Vec2 containing default values.- See Also:
-
Vec2Primitive
Construct a new Vec2Primitive with a provided Vec2.- Parameters:
vec2
- - a Vec2 to be stored in a new Vec2Primitive
-
Vec2Primitive
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 Details
-
getBaseType
Get the BaseType associated to this Vec2Primitive.- Specified by:
getBaseType
in interfaceIPrimitiveType<Vec2Primitive,
Vec2>
-
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
Get this Vec2Primitive's instance value.- Specified by:
getValue
in interfaceIPrimitiveType<Vec2Primitive,
Vec2> - Returns:
- This Vec2Primitive's value
-
compareTo
- Specified by:
compareTo
in interfaceComparable
-
compare
- Specified by:
compare
in interfaceComparator<Vec2Primitive>
-
toString
-
clone
Clone the current Vec2Primitive instance.- Specified by:
clone
in interfaceIPrimitiveType<Vec2Primitive,
Vec2> - Overrides:
clone
in classObject
-
convertFromObject
@ThingworxExtensionApiMethod(since={7,1}) public static Vec2Primitive convertFromObject(Object data) throws 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:
Exception
- if an error occurs
-
getStringValue
- Specified by:
getStringValue
in interfaceIPrimitiveType<Vec2Primitive,
Vec2>
-
setValue
- Specified by:
setValue
in interfaceIPrimitiveType<Vec2Primitive,
Vec2>
-