Class FieldDefinitionCollection
java.lang.Object
java.util.AbstractMap<String,FieldDefinition>
java.util.HashMap<String,FieldDefinition>
java.util.LinkedHashMap<String,FieldDefinition>
com.thingworx.types.collections.GenericObjectCollection<FieldDefinition>
com.thingworx.types.collections.NamedObjectCollection<FieldDefinition>
com.thingworx.metadata.collections.FieldDefinitionCollection
- All Implemented Interfaces:
IDiffableObject
,Serializable
,Cloneable
,Map<String,
,FieldDefinition> SequencedMap<String,
FieldDefinition>
@ThingworxExtensionApiClass(since={6,6},
canInstantiate=true)
public final class FieldDefinitionCollection
extends NamedObjectCollection<FieldDefinition>
A map of field names to their associated field definitions. A
FieldDefinitionCollection
supports serialization to XML and JSON,
as well as creating derived data shape definitions. Fields belonging to this map can be iterated over according to their ordinality or
storage order.- 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 TypeMethodDescriptionvoid
Adds a new field definition to this data shape definition.clone()
Returns a deep clone of this collection.getFieldDefinition
(String name)
Returns the field definition with the specified name.
Returns a list of the field definitions in this collection using their natural order.
Returns a list of field definitions in this collection using the order defined by their ordinality.Methods inherited from class com.thingworx.types.collections.NamedObjectCollection
getNamesAsInfoTable, getOrderedList
Methods inherited from class com.thingworx.types.collections.GenericObjectCollection
containsEntity, getDescription, getName, getNames
Methods inherited from class java.util.LinkedHashMap
clear, containsValue, entrySet, forEach, get, getOrDefault, keySet, newLinkedHashMap, putFirst, putLast, removeEldestEntry, replaceAll, reversed, sequencedEntrySet, sequencedKeySet, sequencedValues, values
Methods inherited from class java.util.HashMap
compute, computeIfAbsent, computeIfPresent, containsKey, isEmpty, merge, newHashMap, put, putAll, putIfAbsent, remove, remove, replace, replace, size
Methods inherited from class java.util.AbstractMap
equals, hashCode, toString
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, containsKey, equals, hashCode, isEmpty, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, size
Methods inherited from interface java.util.SequencedMap
firstEntry, lastEntry, pollFirstEntry, pollLastEntry
-
Constructor Details
-
FieldDefinitionCollection
public FieldDefinitionCollection()
-
-
Method Details
-
getFieldDefinition
Returns the field definition with the specified name.- Parameters:
name
- the name of the field to return- Returns:
- the specified field definition, or
null
if the field does not exist
-
addFieldDefinition
Adds a new field definition to this data shape definition.- Parameters:
field
- the field definition to add
-
toDataShape
- Returns:
- a
DataShapeDefinition
containing this collection's field definitions
-
getOrderedFields
Returns a list of the field definitions in this collection using their natural order.- Returns:
- a sorted list of field definitions
-
getOrderedFieldsByOrdinal
@ThingworxExtensionApiMethod(since={6,6}) public ArrayList<FieldDefinition> getOrderedFieldsByOrdinal()
Returns a list of field definitions in this collection using the order defined by their ordinality.- Returns:
- a sorted list of field definitions
-
clone
Returns a deep clone of this collection.- Overrides:
clone
in classHashMap<String,
FieldDefinition> - Returns:
- a clone of this collection
-