Package com.thingworx.types.collections
Class ValueCollection
- java.lang.Object
-
- java.util.AbstractMap<K,V>
-
- java.util.HashMap<java.lang.String,IPrimitiveType>
-
- com.thingworx.types.collections.ValueCollection
-
- All Implemented Interfaces:
IDiffableObject
,java.io.Serializable
,java.lang.Cloneable
,java.util.Map<java.lang.String,IPrimitiveType>
- Direct Known Subclasses:
AspectCollection
@ThingworxExtensionApiClass(since={6,6}, canInstantiate=true) public class ValueCollection extends java.util.HashMap<java.lang.String,IPrimitiveType> implements java.lang.Cloneable, IDiffableObject
A ValueCollection is aHashMap
that maps Strings to Primitives. ValueCollections are used within
to represent rows of data.InfoTable
s- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description ValueCollection()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description ValueCollection
clone()
static ValueCollection
fromJSONTyped(java.lang.Object object, DataShapeDefinition type)
Deprecated.java.lang.Object
getJSONSerializedValue(java.lang.String name)
Deprecated.no replacementIPrimitiveType
getPrimitive(java.lang.String name)
java.lang.String
getStringValue(java.lang.String name)
java.lang.Object
getValue(java.lang.String name)
boolean
has(java.lang.String name)
boolean
matches(ValueCollection valuesToCompare)
void
SetBooleanValue(java.lang.String name, java.lang.Object value)
void
SetDateTimeValue(java.lang.String name, java.lang.Object value)
void
SetImageValue(java.lang.String name, java.lang.Object value)
void
SetInfoTableValue(java.lang.String name, java.lang.Object value)
void
SetIntegerValue(java.lang.String name, java.lang.Object value)
void
SetJSONValue(java.lang.String name, java.lang.Object value)
void
SetLocationValue(java.lang.String name, java.lang.Object value)
void
SetLongValue(java.lang.String name, java.lang.Object value)
void
SetNumberValue(java.lang.String name, java.lang.Object value)
void
SetStringValue(java.lang.String name, java.lang.Object value)
void
SetTagsValue(java.lang.String name, java.lang.Object value)
void
SetThingCodeValue(java.lang.String name, java.lang.Object value)
void
setValue(java.lang.String name, IPrimitiveType value)
void
SetValue(java.lang.String name, java.lang.Object value, BaseTypes baseType)
void
SetVec2Value(java.lang.String name, java.lang.Object value)
void
SetVec3Value(java.lang.String name, java.lang.Object value)
void
SetVec4Value(java.lang.String name, java.lang.Object value)
void
SetXMLValue(java.lang.String name, java.lang.Object value)
InfoTable
toInfoTable()
org.json.JSONObject
toJSON()
Deprecated.no replacementorg.json.JSONObject
toJSONTyped(DataShapeDefinition dataShapeDefinition)
Deprecated.no replacementNamedValueCollection
toNamedValueCollection()
-
Methods inherited from class java.util.HashMap
clear, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, forEach, get, getOrDefault, isEmpty, keySet, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, values
-
-
-
-
Method Detail
-
setValue
@ThingworxExtensionApiMethod(since={6,6}) public void setValue(java.lang.String name, IPrimitiveType value) throws java.lang.Exception
- Throws:
java.lang.Exception
- If an error occurs
-
SetValue
@ThingworxExtensionApiMethod(since={6,6}) public void SetValue(java.lang.String name, java.lang.Object value, BaseTypes baseType) throws java.lang.Exception
- Throws:
java.lang.Exception
- If an error occurs
-
SetBooleanValue
@ThingworxExtensionApiMethod(since={6,6}) public void SetBooleanValue(java.lang.String name, java.lang.Object value) throws java.lang.Exception
- Throws:
java.lang.Exception
- If an error occurs
-
SetNumberValue
@ThingworxExtensionApiMethod(since={6,6}) public void SetNumberValue(java.lang.String name, java.lang.Object value) throws java.lang.Exception
- Throws:
java.lang.Exception
- If an error occurs
-
SetIntegerValue
@ThingworxExtensionApiMethod(since={6,6}) public void SetIntegerValue(java.lang.String name, java.lang.Object value) throws java.lang.Exception
- Throws:
java.lang.Exception
- If an error occurs
-
SetLongValue
@ThingworxExtensionApiMethod(since={6,6}) public void SetLongValue(java.lang.String name, java.lang.Object value) throws java.lang.Exception
- Throws:
java.lang.Exception
- If an error occurs
-
SetImageValue
@ThingworxExtensionApiMethod(since={6,6}) public void SetImageValue(java.lang.String name, java.lang.Object value) throws java.lang.Exception
- Throws:
java.lang.Exception
- If an error occurs
-
SetTagsValue
@ThingworxExtensionApiMethod(since={6,6}) public void SetTagsValue(java.lang.String name, java.lang.Object value) throws java.lang.Exception
- Throws:
java.lang.Exception
- If an error occurs
-
SetInfoTableValue
@ThingworxExtensionApiMethod(since={6,6}) public void SetInfoTableValue(java.lang.String name, java.lang.Object value) throws java.lang.Exception
- Throws:
java.lang.Exception
- If an error occurs
-
SetDateTimeValue
@ThingworxExtensionApiMethod(since={6,6}) public void SetDateTimeValue(java.lang.String name, java.lang.Object value) throws java.lang.Exception
- Throws:
java.lang.Exception
- If an error occurs
-
SetStringValue
@ThingworxExtensionApiMethod(since={6,6}) public void SetStringValue(java.lang.String name, java.lang.Object value) throws java.lang.Exception
- Throws:
java.lang.Exception
- If an error occurs
-
SetLocationValue
@ThingworxExtensionApiMethod(since={6,6}) public void SetLocationValue(java.lang.String name, java.lang.Object value) throws java.lang.Exception
- Throws:
java.lang.Exception
- If an error occurs
-
SetVec2Value
@ThingworxExtensionApiMethod(since={7,1}) public void SetVec2Value(java.lang.String name, java.lang.Object value) throws java.lang.Exception
- Throws:
java.lang.Exception
- If an error occurs
-
SetVec3Value
@ThingworxExtensionApiMethod(since={7,1}) public void SetVec3Value(java.lang.String name, java.lang.Object value) throws java.lang.Exception
- Throws:
java.lang.Exception
- If an error occurs
-
SetVec4Value
@ThingworxExtensionApiMethod(since={7,1}) public void SetVec4Value(java.lang.String name, java.lang.Object value) throws java.lang.Exception
- Throws:
java.lang.Exception
- If an error occurs
-
SetThingCodeValue
@ThingworxExtensionApiMethod(since={7,1}) public void SetThingCodeValue(java.lang.String name, java.lang.Object value) throws java.lang.Exception
- Throws:
java.lang.Exception
- If an error occurs
-
SetXMLValue
@ThingworxExtensionApiMethod(since={6,6}) public void SetXMLValue(java.lang.String name, java.lang.Object value) throws java.lang.Exception
- Throws:
java.lang.Exception
- If an error occurs
-
SetJSONValue
@ThingworxExtensionApiMethod(since={6,6}) public void SetJSONValue(java.lang.String name, java.lang.Object value) throws java.lang.Exception
- Throws:
java.lang.Exception
- If an error occurs
-
getJSONSerializedValue
@Deprecated @ThingworxExtensionApiMethod(since={6,6}, deprecatedSince={8,4}) public java.lang.Object getJSONSerializedValue(java.lang.String name) throws java.lang.Exception
Deprecated.no replacement- Parameters:
name
- the name of the value to retrieve- Returns:
- the value, or
null
if no value with the specified name exists - Throws:
java.lang.Exception
- if an exception occurs
-
getValue
@ThingworxExtensionApiMethod(since={6,6}) public java.lang.Object getValue(java.lang.String name)
-
getStringValue
@ThingworxExtensionApiMethod(since={6,6}) public java.lang.String getStringValue(java.lang.String name)
-
getPrimitive
@ThingworxExtensionApiMethod(since={6,6}) public IPrimitiveType getPrimitive(java.lang.String name)
-
clone
@ThingworxExtensionApiMethod(since={6,6}) public ValueCollection clone()
- Overrides:
clone
in classjava.util.HashMap<java.lang.String,IPrimitiveType>
-
matches
@ThingworxExtensionApiMethod(since={6,6}) public boolean matches(ValueCollection valuesToCompare)
-
fromJSONTyped
@Deprecated @ThingworxExtensionApiMethod(since={6,6}, deprecatedSince={8,4}) public static ValueCollection fromJSONTyped(java.lang.Object object, DataShapeDefinition type) throws java.lang.Exception
Deprecated.- Throws:
java.lang.Exception
- If an error occurs
-
toJSONTyped
@Deprecated @ThingworxExtensionApiMethod(since={6,6}, deprecatedSince={8,4}) public org.json.JSONObject toJSONTyped(DataShapeDefinition dataShapeDefinition) throws java.lang.Exception
Deprecated.no replacement
Gets the JSON representation of this collection, populating the resulting JSON object only with properties whose names match the Fields within the specified DataShapeDefinition. If a value within this collection is null, then no entry for that value will be added to the returned JSON object, even if its name matches a Field within the DataShapeDefinition.- Parameters:
dataShapeDefinition
- contains the Fields governing how the returned JSON object is populated- Returns:
- a non-null JSON object containing only those properties from this collection whose names match Field names within the specified DataShapeDefinition
- Throws:
java.lang.Exception
- if an error occurs
-
toJSON
@Deprecated @ThingworxExtensionApiMethod(since={6,6}, deprecatedSince={8,4}) public org.json.JSONObject toJSON() throws java.lang.Exception
Deprecated.no replacement
Returns a JSON representation of this ValueCollection.- Returns:
- a JSON object
- Throws:
java.lang.Exception
- if an error occurs
-
has
@ThingworxExtensionApiMethod(since={6,6}) public boolean has(java.lang.String name)
-
toInfoTable
@ThingworxExtensionApiMethod(since={6,6}) public InfoTable toInfoTable()
-
toNamedValueCollection
@ThingworxExtensionApiMethod(since={6,6}) public NamedValueCollection toNamedValueCollection()
-
-