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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds 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.Returns a newDataShapeDefinitioncontaining the field definitions stored in this collection.Methods inherited from class com.thingworx.types.collections.NamedObjectCollection
getNamesAsInfoTable, getOrderedListMethods inherited from class com.thingworx.types.collections.GenericObjectCollection
containsEntity, getDescription, getName, getNamesMethods inherited from class java.util.LinkedHashMap
clear, containsValue, entrySet, forEach, get, getOrDefault, keySet, newLinkedHashMap, putFirst, putLast, removeEldestEntry, replaceAll, reversed, sequencedEntrySet, sequencedKeySet, sequencedValues, valuesMethods inherited from class java.util.HashMap
compute, computeIfAbsent, computeIfPresent, containsKey, isEmpty, merge, newHashMap, put, putAll, putIfAbsent, remove, remove, replace, replace, sizeMethods inherited from class java.util.AbstractMap
equals, hashCode, toStringMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, containsKey, equals, hashCode, isEmpty, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, sizeMethods inherited from interface java.util.SequencedMap
firstEntry, lastEntry, pollFirstEntry, pollLastEntry
-
Constructor Details
-
FieldDefinitionCollection
public FieldDefinitionCollection()Initializes this instace with default values.
-
-
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
nullif 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 newDataShapeDefinitioncontaining the field definitions stored in this collection.- Returns:
- a
DataShapeDefinitioncontaining 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:
clonein classHashMap<String,FieldDefinition> - Returns:
- a clone of this collection
-