Package com.thingworx.types.collections
Class ValueCollection
- All Implemented Interfaces:
IDiffableObject
,Serializable
,Cloneable
,Map<String,
IPrimitiveType>
- Direct Known Subclasses:
AspectCollection
@ThingworxExtensionApiClass(since={6,6},
canInstantiate=true)
public class ValueCollection
extends HashMap<String,IPrimitiveType>
implements Cloneable, IDiffableObject
A ValueCollection is a
HashMap
that maps Strings to Primitives.
ValueCollections are used within InfoTable
s
to represent rows of data.- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K,
V>, AbstractMap.SimpleImmutableEntry<K, V> -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionclone()
static ValueCollection
fromJSONTyped
(Object object, DataShapeDefinition type) Deprecated.getJSONSerializedValue
(String name) Deprecated.no replacementgetPrimitive
(String name) getStringValue
(String name) boolean
boolean
matches
(ValueCollection valuesToCompare) void
SetBooleanValue
(String name, Object value) void
SetDateTimeValue
(String name, Object value) void
SetImageValue
(String name, Object value) void
SetInfoTableValue
(String name, Object value) void
SetIntegerValue
(String name, Object value) void
SetJSONValue
(String name, Object value) void
SetLocationValue
(String name, Object value) void
SetLongValue
(String name, Object value) void
SetNumberValue
(String name, Object value) void
SetStringValue
(String name, Object value) void
SetTagsValue
(String name, Object value) void
SetThingCodeValue
(String name, Object value) void
setValue
(String name, IPrimitiveType value) void
void
SetVec2Value
(String name, Object value) void
SetVec3Value
(String name, Object value) void
SetVec4Value
(String name, Object value) void
SetXMLValue
(String name, Object value) org.json.JSONObject
toJSON()
Deprecated.no replacementorg.json.JSONObject
toJSONTyped
(DataShapeDefinition dataShapeDefinition) Deprecated.no replacementMethods inherited from class java.util.HashMap
clear, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, forEach, get, getOrDefault, isEmpty, keySet, merge, newHashMap, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, values
Methods inherited from class java.util.AbstractMap
equals, hashCode, toString
-
Constructor Details
-
ValueCollection
public ValueCollection()
-
-
Method Details
-
setValue
@ThingworxExtensionApiMethod(since={6,6}) public void setValue(String name, IPrimitiveType value) throws Exception - Throws:
Exception
- If an error occurs
-
SetValue
@ThingworxExtensionApiMethod(since={6,6}) public void SetValue(String name, Object value, BaseTypes baseType) throws Exception - Throws:
Exception
- If an error occurs
-
SetBooleanValue
@ThingworxExtensionApiMethod(since={6,6}) public void SetBooleanValue(String name, Object value) throws Exception - Throws:
Exception
- If an error occurs
-
SetNumberValue
@ThingworxExtensionApiMethod(since={6,6}) public void SetNumberValue(String name, Object value) throws Exception - Throws:
Exception
- If an error occurs
-
SetIntegerValue
@ThingworxExtensionApiMethod(since={6,6}) public void SetIntegerValue(String name, Object value) throws Exception - Throws:
Exception
- If an error occurs
-
SetLongValue
@ThingworxExtensionApiMethod(since={6,6}) public void SetLongValue(String name, Object value) throws Exception - Throws:
Exception
- If an error occurs
-
SetImageValue
@ThingworxExtensionApiMethod(since={6,6}) public void SetImageValue(String name, Object value) throws Exception - Throws:
Exception
- If an error occurs
-
SetTagsValue
@ThingworxExtensionApiMethod(since={6,6}) public void SetTagsValue(String name, Object value) throws Exception - Throws:
Exception
- If an error occurs
-
SetInfoTableValue
@ThingworxExtensionApiMethod(since={6,6}) public void SetInfoTableValue(String name, Object value) throws Exception - Throws:
Exception
- If an error occurs
-
SetDateTimeValue
@ThingworxExtensionApiMethod(since={6,6}) public void SetDateTimeValue(String name, Object value) throws Exception - Throws:
Exception
- If an error occurs
-
SetStringValue
@ThingworxExtensionApiMethod(since={6,6}) public void SetStringValue(String name, Object value) throws Exception - Throws:
Exception
- If an error occurs
-
SetLocationValue
@ThingworxExtensionApiMethod(since={6,6}) public void SetLocationValue(String name, Object value) throws Exception - Throws:
Exception
- If an error occurs
-
SetVec2Value
@ThingworxExtensionApiMethod(since={7,1}) public void SetVec2Value(String name, Object value) throws Exception - Throws:
Exception
- If an error occurs
-
SetVec3Value
@ThingworxExtensionApiMethod(since={7,1}) public void SetVec3Value(String name, Object value) throws Exception - Throws:
Exception
- If an error occurs
-
SetVec4Value
@ThingworxExtensionApiMethod(since={7,1}) public void SetVec4Value(String name, Object value) throws Exception - Throws:
Exception
- If an error occurs
-
SetThingCodeValue
@ThingworxExtensionApiMethod(since={7,1}) public void SetThingCodeValue(String name, Object value) throws Exception - Throws:
Exception
- If an error occurs
-
SetXMLValue
@ThingworxExtensionApiMethod(since={6,6}) public void SetXMLValue(String name, Object value) throws Exception - Throws:
Exception
- If an error occurs
-
SetJSONValue
@ThingworxExtensionApiMethod(since={6,6}) public void SetJSONValue(String name, Object value) throws Exception - Throws:
Exception
- If an error occurs
-
getJSONSerializedValue
@Deprecated @ThingworxExtensionApiMethod(since={6,6}, deprecatedSince={8,4}) public Object getJSONSerializedValue(String name) throws 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:
Exception
- if an exception occurs
-
getValue
-
getStringValue
-
getPrimitive
-
clone
- Overrides:
clone
in classHashMap<String,
IPrimitiveType>
-
matches
-
fromJSONTyped
@Deprecated @ThingworxExtensionApiMethod(since={6,6}, deprecatedSince={8,4}) public static ValueCollection fromJSONTyped(Object object, DataShapeDefinition type) throws Exception Deprecated.- Throws:
Exception
- If an error occurs
-
toJSONTyped
@Deprecated @ThingworxExtensionApiMethod(since={6,6}, deprecatedSince={8,4}) public org.json.JSONObject toJSONTyped(DataShapeDefinition dataShapeDefinition) throws 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:
Exception
- if an error occurs
-
toJSON
@Deprecated @ThingworxExtensionApiMethod(since={6,6}, deprecatedSince={8,4}) public org.json.JSONObject toJSON() throws ExceptionDeprecated.no replacement
Returns a JSON representation of this ValueCollection.- Returns:
- a JSON object
- Throws:
Exception
- if an error occurs
-
has
-
toInfoTable
-
toNamedValueCollection
-