Class QualifiedPath
- java.lang.Object
- 
- com.inductiveautomation.ignition.common.QualifiedPath
 
- 
- All Implemented Interfaces:
- Path,- java.io.Serializable
 
 public class QualifiedPath extends java.lang.Object implements java.io.Serializable, Path This class is a path to anything in Ignition, across any system. It dictates how the path is formed, but the actual meaning of different subcomponents will depend on the context in which the path is used.- See Also:
- Serialized Form
 
- 
- 
Nested Class SummaryNested Classes Modifier and Type Class Description static classQualifiedPath.BuilderA builder to assist in constructingQualifiedPaths.static classQualifiedPath.Partstatic classQualifiedPath.QualifiedPathSimpleTypeAdapter
 - 
Field SummaryFields Modifier and Type Field Description protected static java.lang.StringCOMPONENTID_SEPERATORprotected static java.lang.StringPART_SEPERATORprotected static java.lang.StringSUBPART_SEPERATOR- 
Fields inherited from interface com.inductiveautomation.ignition.common.PathSERIALIZATION_WHITELIST
 
- 
 - 
Constructor SummaryConstructors Constructor Description QualifiedPath()
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description QualifiedPathclone()booleanequals(java.lang.Object obj)QualifiedPathextend(java.lang.String id, java.lang.String value)Returns a path with the provided component added on at the end.java.lang.StringgetFirstPathComponent()java.lang.StringgetFirstPathComponentId()java.lang.StringgetLastPathComponent()Convenience function to return the last path element.java.lang.StringgetLastPathComponentId()QualifiedPathgetParentPath()Returns a path representing the element above the current path.QualifiedPath.PartgetPart(int i)protected QualifiedPath.Part[]getPartsFor(java.lang.String id)Returns all of the sub parts for a specified id, or null if they don't exist.java.lang.StringgetPathComponent(int i)Returns the path element at the specified location.java.lang.StringgetPathComponent(java.lang.String id)java.lang.StringgetPathComponentOrElse(java.lang.String id, java.lang.String orElse)intgetPathLength()Returns the number of elements in the path, which can be retrieved through getPathComponent().inthashCode()booleanhasPathComponent(java.lang.String id)protected intindexOf(java.lang.String id)QualifiedPathinsert(java.lang.String id, java.lang.String value, java.lang.String beforeComponentId)Locates the component specified and inserts the new component before it.booleanisAncestorOf(Path child)Returns whether the provided path is a child path of this one.static QualifiedPathof(java.lang.String... idValPairs)Creates a path out of the specified id/value pairs.static QualifiedPathparse(java.lang.String value)Attempts to parse the string into an QualifiedPath.static QualifiedPathparseSafe(java.lang.String value)Same as parse(), but catches exceptions and returns null on bad paths.protected static java.util.List<QualifiedPath.Part>parseSubParts(java.lang.String id, java.lang.String value)Returns at least one part for the root, with id.QualifiedPathprepend(java.lang.String id, java.lang.String value)Returns a new path with the provided component added at the beginning.QualifiedPathremove(java.lang.String id)Removes the given component, if present.QualifiedPathreplace(java.lang.String id, java.lang.String value)If the component specified by the given id exists in the path, the value will be replaced with the new value.QualifiedPathstrip()Removes the last fully-qualified component from the path.QualifiedPathsubpath()Removes the first path component and returns the rest as a new path.QualifiedPathsubpath(java.lang.String id)Returns the paths that comes after the first instance of the specified id.java.lang.StringtoString()java.lang.StringtoStringSimple()Returns the path in a friendlier to read form, without component ids.
 
- 
- 
- 
Field Detail- 
SUBPART_SEPERATORprotected static final java.lang.String SUBPART_SEPERATOR - See Also:
- Constant Field Values
 
 - 
PART_SEPERATORprotected static final java.lang.String PART_SEPERATOR - See Also:
- Constant Field Values
 
 - 
COMPONENTID_SEPERATORprotected static final java.lang.String COMPONENTID_SEPERATOR - See Also:
- Constant Field Values
 
 
- 
 - 
Method Detail- 
clonepublic QualifiedPath clone() - Overrides:
- clonein class- java.lang.Object
 
 - 
ofpublic static QualifiedPath of(java.lang.String... idValPairs) Creates a path out of the specified id/value pairs. The parameters must be in the form "id,value,id,value".
 - 
extendpublic QualifiedPath extend(java.lang.String id, java.lang.String value) Returns a path with the provided component added on at the end.
 - 
prependpublic QualifiedPath prepend(java.lang.String id, java.lang.String value) Returns a new path with the provided component added at the beginning.
 - 
insertpublic QualifiedPath insert(java.lang.String id, java.lang.String value, java.lang.String beforeComponentId) Locates the component specified and inserts the new component before it.
 - 
getPathLengthpublic int getPathLength() Description copied from interface:PathReturns the number of elements in the path, which can be retrieved through getPathComponent().- Specified by:
- getPathLengthin interface- Path
 
 - 
getPart@Nullable public QualifiedPath.Part getPart(int i) 
 - 
getPathComponentpublic java.lang.String getPathComponent(int i) Description copied from interface:PathReturns the path element at the specified location.- Specified by:
- getPathComponentin interface- Path
 
 - 
getLastPathComponentpublic java.lang.String getLastPathComponent() Description copied from interface:PathConvenience function to return the last path element.- Specified by:
- getLastPathComponentin interface- Path
 
 - 
getLastPathComponentId@Nullable public java.lang.String getLastPathComponentId() 
 - 
getFirstPathComponentpublic java.lang.String getFirstPathComponent() 
 - 
getFirstPathComponentIdpublic java.lang.String getFirstPathComponentId() 
 - 
subpathpublic QualifiedPath subpath() Removes the first path component and returns the rest as a new path.
 - 
subpathpublic QualifiedPath subpath(java.lang.String id) Returns the paths that comes after the first instance of the specified id.- Parameters:
- id- component id after which the subsequent path parts will be returned.
- Returns:
- everything after the specified id, or null if id is not found.
 
 - 
strippublic QualifiedPath strip() Removes the last fully-qualified component from the path. This differs from getParentPath() in that that function doesn't care whether the component is qualified or not.
 - 
removepublic QualifiedPath remove(java.lang.String id) Removes the given component, if present.
 - 
replacepublic QualifiedPath replace(java.lang.String id, java.lang.String value) If the component specified by the given id exists in the path, the value will be replaced with the new value.
 - 
indexOfprotected int indexOf(java.lang.String id) 
 - 
getPathComponent@Nullable public java.lang.String getPathComponent(@Nullable java.lang.String id)
 - 
getPathComponentOrElse@Nonnull public java.lang.String getPathComponentOrElse(@Nullable java.lang.String id, @Nonnull java.lang.String orElse)
 - 
getPartsFor@Nullable protected QualifiedPath.Part[] getPartsFor(@Nullable java.lang.String id) Returns all of the sub parts for a specified id, or null if they don't exist.
 - 
hasPathComponentpublic boolean hasPathComponent(java.lang.String id) 
 - 
getParentPathpublic QualifiedPath getParentPath() Description copied from interface:PathReturns a path representing the element above the current path.- Specified by:
- getParentPathin interface- Path
 
 - 
toString@Nonnull public java.lang.String toString() - Overrides:
- toStringin class- java.lang.Object
 
 - 
toStringSimple@Nonnull public java.lang.String toStringSimple() Returns the path in a friendlier to read form, without component ids.
 - 
isAncestorOfpublic boolean isAncestorOf(Path child) Description copied from interface:PathReturns whether the provided path is a child path of this one.- Specified by:
- isAncestorOfin interface- Path
 
 - 
hashCodepublic int hashCode() - Overrides:
- hashCodein class- java.lang.Object
 
 - 
equalspublic boolean equals(java.lang.Object obj) - Overrides:
- equalsin class- java.lang.Object
 
 - 
parsepublic static QualifiedPath parse(java.lang.String value) throws java.io.IOException Attempts to parse the string into an QualifiedPath. IOException is thrown on invalid path.- Throws:
- java.io.IOException
 
 - 
parseSafepublic static QualifiedPath parseSafe(java.lang.String value) Same as parse(), but catches exceptions and returns null on bad paths.
 - 
parseSubPartsprotected static java.util.List<QualifiedPath.Part> parseSubParts(java.lang.String id, java.lang.String value) Returns at least one part for the root, with id. If the value contains sub parts, those will be returned as well. The root part will have the sub part count set on it already.
 
- 
 
-