Class BasicTagConfiguration
java.lang.Object
com.inductiveautomation.ignition.common.tags.config.BasicTagConfiguration
- All Implemented Interfaces:
BoundPropertySet
,Countable
,Extendable<PropertySet>
,Mergable<PropertySet>
,MutablePropertyValueSource
,PropertySet
,PropertyValueSource
,TagConfiguration
,Serializable
,Iterable<PropertyValue>
Contains the local config changes of a tag. Used with gateway communication where inherited props aren't necessary.
- See Also:
-
Field Summary
Fields inherited from interface com.inductiveautomation.ignition.common.config.PropertySet
EMPTY
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
BasicTagConfiguration
(boolean isNew) protected
BasicTagConfiguration
(TagPath path, boolean removed) BasicTagConfiguration
(TagPath path, BoundPropertySet config, boolean isNew) BasicTagConfiguration
(TagPath tagPath, BoundPropertySet config, boolean isNew, boolean isRemoved, List<TagConfiguration> children) Use for Protobuf deserialization only -
Method Summary
Modifier and TypeMethodDescriptionvoid
addChild
(TagConfiguration member) Member edits are tags beneath this one.boolean
static BasicTagConfiguration
createDelete
(TagPath path) static TagConfiguration
createEdit
(TagPath path) Creates an edit for the path with an empty property set that can be modified through getConfig()static BasicTagConfiguration
createEdit
(TagPath path, BoundPropertySet config) See createNew() for more details, but in short, only use this version when you know you want to edit/overwrite a specific existing tag.static TagConfiguration
Creates a new tag edit.static BasicTagConfiguration
createNew
(TagPath path, BoundPropertySet config) static TagConfiguration
createRename
(TagPath originalPath, String name) <T> T
Retrieves the value of the property, or null if this set doesn't contain that property.Collection<Property<?>>
getBoundValue
(Property<?> prop) Non-modifiable list of member edits.int
getCount()
getName()
<T> T
getOrDefault
(Property<T> prop) <T> T
Get the value for a givenProperty
, or else fall back to value if it's not present.getPath()
Collection<Property<?>>
Returns just the properties of this tag.getType()
boolean
boolean
isExtended
(Property<?> prop) Returns whether this property set contains a value for the prop, and the prop was actually inherited.boolean
isInherited
(Property<?> prop) Indicates whether the property was inherited from a parent type.boolean
isNew()
boolean
boolean
isRename()
iterator()
void
<T> void
void
set
(PropertyValue propValue) void
setBoundValue
(Property<?> prop, BoundValue value) void
void
setNew
(boolean val) void
void
setType
(TagObjectType type) Set the core object type of this node.toString()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface com.inductiveautomation.ignition.common.config.BoundPropertySet
extend, getBoundOrDefault, getValues, newDefaultInstance, newExtension
Methods inherited from interface java.lang.Iterable
forEach, spliterator
Methods inherited from interface com.inductiveautomation.ignition.common.config.MutablePropertyValueSource
merge
Methods inherited from interface com.inductiveautomation.ignition.common.config.PropertySet
getExtension
Methods inherited from interface com.inductiveautomation.ignition.common.config.PropertyValueSource
getNonNull, getNonNull
-
Constructor Details
-
BasicTagConfiguration
public BasicTagConfiguration() -
BasicTagConfiguration
protected BasicTagConfiguration(boolean isNew) -
BasicTagConfiguration
-
BasicTagConfiguration
public BasicTagConfiguration(@Nullable TagPath path, @Nullable BoundPropertySet config, boolean isNew) -
BasicTagConfiguration
public BasicTagConfiguration(TagPath tagPath, BoundPropertySet config, boolean isNew, boolean isRemoved, List<TagConfiguration> children) Use for Protobuf deserialization only
-
-
Method Details
-
getTagProperties
Description copied from interface:TagConfiguration
Returns just the properties of this tag.- Specified by:
getTagProperties
in interfaceTagConfiguration
-
createEdit
Creates an edit for the path with an empty property set that can be modified through getConfig() -
createNew
Creates a new tag edit. This is the creation function that should be used most often, if there's any doubt whether we want to create or edit a tag. createEdit() should be called only when we know we are editing a specific tag instance. We can edit tags even with this "new" TagEdit, it will just require the collision policy to be Overwrite. -
createNew
-
createEdit
See createNew() for more details, but in short, only use this version when you know you want to edit/overwrite a specific existing tag. -
createDelete
-
createRename
-
getConfig
-
setNew
public void setNew(boolean val) - Specified by:
setNew
in interfaceTagConfiguration
-
getName
- Specified by:
getName
in interfaceTagConfiguration
-
getPath
- Specified by:
getPath
in interfaceTagConfiguration
-
setPath
- Specified by:
setPath
in interfaceTagConfiguration
-
getType
- Specified by:
getType
in interfaceTagConfiguration
-
setType
Set the core object type of this node. Should not be called very often, it would be rare to really change the type.- Specified by:
setType
in interfaceTagConfiguration
-
setName
- Specified by:
setName
in interfaceTagConfiguration
-
isRemoved
public boolean isRemoved()- Specified by:
isRemoved
in interfaceTagConfiguration
-
isRename
public boolean isRename() -
isNew
public boolean isNew()- Specified by:
isNew
in interfaceTagConfiguration
-
addChild
Member edits are tags beneath this one. They should have relative paths (this function will make the path relative if not already).- Specified by:
addChild
in interfaceTagConfiguration
-
getChildren
Non-modifiable list of member edits. Won't return null.- Specified by:
getChildren
in interfaceTagConfiguration
- Returns:
- a list of children configurations, or an empty list. Does not return null.
-
toString
-
isBound
- Specified by:
isBound
in interfaceBoundPropertySet
-
set
- Specified by:
set
in interfaceMutablePropertyValueSource
-
setBoundValue
- Specified by:
setBoundValue
in interfaceBoundPropertySet
-
set
- Specified by:
set
in interfaceMutablePropertyValueSource
-
getCount
public int getCount() -
getBoundValue
- Specified by:
getBoundValue
in interfaceBoundPropertySet
-
remove
- Specified by:
remove
in interfaceMutablePropertyValueSource
-
getBoundProperties
- Specified by:
getBoundProperties
in interfaceBoundPropertySet
-
getProperties
- Specified by:
getProperties
in interfacePropertyValueSource
-
get
Description copied from interface:PropertyValueSource
Retrieves the value of the property, or null if this set doesn't contain that property.- Specified by:
get
in interfacePropertyValueSource
-
iterator
- Specified by:
iterator
in interfaceIterable<PropertyValue>
-
contains
- Specified by:
contains
in interfacePropertyValueSource
- Returns:
- True if the source contains a value for prop.
-
getOrDefault
- Specified by:
getOrDefault
in interfacePropertyValueSource
- Returns:
- The value for prop or
Property.getDefaultValue()
if not present. Can return null if the value is null.
-
getOrElse
Description copied from interface:PropertyValueSource
Get the value for a givenProperty
, or else fall back to value if it's not present.- Specified by:
getOrElse
in interfacePropertyValueSource
- Parameters:
prop
- TheProperty
for which a value is to be retrieved.value
- The value to default to if property isn't present.- Returns:
- The value of property if present, value if not. Can return null if the value is null.
-
isExtended
Description copied from interface:PropertySet
Returns whether this property set contains a value for the prop, and the prop was actually inherited. In other words, this is true if the property is inherited, and an override value is present.- Specified by:
isExtended
in interfacePropertySet
-
isInherited
Description copied from interface:PropertySet
Indicates whether the property was inherited from a parent type.- Specified by:
isInherited
in interfacePropertySet
-