Class UniformItemPathImpl
- java.lang.Object
-
- com.evolveum.midpoint.prism.impl.path.UniformItemPathImpl
-
- All Implemented Interfaces:
ItemPath
,UniformItemPath
,ShortDumpable
,Serializable
,Cloneable
public class UniformItemPathImpl extends Object implements UniformItemPath
- Author:
- semancik
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.evolveum.midpoint.prism.path.ItemPath
ItemPath.CompareResult
-
-
Field Summary
Fields Modifier and Type Field Description static UniformItemPathImpl
EMPTY_PATH
-
Constructor Summary
Constructors Constructor Description UniformItemPathImpl(ItemPath itemPath)
UniformItemPathImpl(ItemPathSegment... segments)
UniformItemPathImpl(UniformItemPath parentPath, ItemPathSegment subSegment)
UniformItemPathImpl(UniformItemPath parentPath, UniformItemPath childPath)
UniformItemPathImpl(UniformItemPath parentPath, QName subName)
UniformItemPathImpl(Object... namesOrIdsOrSegments)
UniformItemPathImpl(String... names)
UniformItemPathImpl(List<ItemPathSegment> segments)
UniformItemPathImpl(List<ItemPathSegment> segments, ItemPathSegment subSegment)
UniformItemPathImpl(List<ItemPathSegment> segments, List<ItemPathSegment> additionalSegments)
UniformItemPathImpl(List<ItemPathSegment> segments, QName subName)
UniformItemPathImpl(QName... qnames)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description UniformItemPath
allExceptLast()
Returns a path containing all segments except the last one.UniformItemPath
allUpToIncluding(int i)
Returns all segments up to the specified one (including it).UniformItemPath
allUpToLastName()
Returns a path containing all segments up to (and not including) the last one.UniformItemPath
append(ItemPathSegment subSegment)
UniformItemPath
append(UniformItemPath subPath)
UniformItemPath
append(Long id)
UniformItemPath
append(Object... components)
Returns a newly created path containing all the segments of this path with added components.UniformItemPath
append(QName childName)
ItemPathType
asItemPathType()
UniformItemPath
clone()
static ItemPathSegment
createSegment(QName qname, boolean variable)
boolean
equals(Object obj)
More strict version of ItemPath comparison.ItemPathSegment
first()
Returns the first segment or null if the path is empty.UniformItemPath
firstAsPath()
Returns first segment in a form of path.static UniformItemPathImpl
fromItemPath(ItemPath itemPath)
Map<String,String>
getNamespaceMap()
ItemPathSegment
getSegment(int i)
Returns the given path segment.List<ItemPathSegment>
getSegments()
Returns the path segments.int
hashCode()
boolean
isEmpty()
Returns true if the path is empty i.e.ItemPathSegment
last()
Returns the last segment (or null if the path is empty).ItemName
lastName()
Returns the last name segment value; or null if there's no name segment.UniformItemPath
namedSegmentsOnly()
Returns the path containing only the regular named segments.UniformItemPathImpl
normalize()
Makes the path "normal" by inserting null Id segments where they were omitted.UniformItemPath
remainder(ItemPath prefix)
Returns the remainder of "this" path after passing all segments from the other path.UniformItemPath
removeIds()
Returns the path with no Id segments.UniformItemPath
rest()
Returns the rest of the path (the tail).UniformItemPath
rest(int n)
Returns the rest of the path (the tail), starting at position "n".void
setNamespaceMap(Map<String,String> namespaceMap)
int
size()
Returns path size i.e.UniformItemPath
stripVariableSegment()
Removes the leading variable segment, if present.UniformItemPathImpl
subPath(int from, int to)
Returns a sub-path from (including) to (excluding) given indices.UniformItemPath
tail(int n)
String
toString()
-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.evolveum.midpoint.prism.path.ItemPath
asSingleName, asSingleNameOrFail, compareComplex, containsNameExactly, containsSpecialSymbols, containsSpecialSymbolsExceptParent, equals, equivalent, firstName, firstNameIndex, firstNameOrFail, firstToId, firstToIdOrNull, firstToName, firstToNameOrNull, firstToVariableNameOrNull, isSingleName, isSubPath, isSubPathOrEquivalent, isSuperPath, isSuperPathOrEquivalent, lastNameIndex, shortDump, startsWith, startsWithId, startsWithIdentifier, startsWithName, startsWithName, startsWithNullId, startsWithObjectReference, startsWithParent, startsWithVariable
-
Methods inherited from interface com.evolveum.midpoint.util.ShortDumpable
shortDump, shortDumpLazily
-
-
-
-
Field Detail
-
EMPTY_PATH
public static final UniformItemPathImpl EMPTY_PATH
-
-
Constructor Detail
-
UniformItemPathImpl
public UniformItemPathImpl(QName... qnames)
-
UniformItemPathImpl
public UniformItemPathImpl(String... names)
-
UniformItemPathImpl
public UniformItemPathImpl(@NotNull ItemPath itemPath)
-
UniformItemPathImpl
public UniformItemPathImpl(Object... namesOrIdsOrSegments)
-
UniformItemPathImpl
public UniformItemPathImpl(UniformItemPath parentPath, QName subName)
-
UniformItemPathImpl
public UniformItemPathImpl(UniformItemPath parentPath, UniformItemPath childPath)
-
UniformItemPathImpl
public UniformItemPathImpl(List<ItemPathSegment> segments)
-
UniformItemPathImpl
public UniformItemPathImpl(List<ItemPathSegment> segments, ItemPathSegment subSegment)
-
UniformItemPathImpl
public UniformItemPathImpl(List<ItemPathSegment> segments, QName subName)
-
UniformItemPathImpl
public UniformItemPathImpl(List<ItemPathSegment> segments, List<ItemPathSegment> additionalSegments)
-
UniformItemPathImpl
public UniformItemPathImpl(ItemPathSegment... segments)
-
UniformItemPathImpl
public UniformItemPathImpl(UniformItemPath parentPath, ItemPathSegment subSegment)
-
-
Method Detail
-
fromItemPath
@NotNull public static UniformItemPathImpl fromItemPath(ItemPath itemPath)
-
createSegment
public static ItemPathSegment createSegment(QName qname, boolean variable)
-
setNamespaceMap
public void setNamespaceMap(Map<String,String> namespaceMap)
- Specified by:
setNamespaceMap
in interfaceUniformItemPath
-
getNamespaceMap
public Map<String,String> getNamespaceMap()
- Specified by:
getNamespaceMap
in interfaceUniformItemPath
-
append
@NotNull public UniformItemPath append(Object... components)
Description copied from interface:ItemPath
Returns a newly created path containing all the segments of this path with added components.- Specified by:
append
in interfaceItemPath
- Specified by:
append
in interfaceUniformItemPath
-
append
public UniformItemPath append(Long id)
-
append
public UniformItemPath append(ItemPathSegment subSegment)
-
append
public UniformItemPath append(UniformItemPath subPath)
-
getSegments
@NotNull public List<ItemPathSegment> getSegments()
Description copied from interface:ItemPath
Returns the path segments. Avoid using this method and access segments directly. Instead try to find suitable method in ItemPath interface. NEVER change path content using this method. TODO consider returning unmodifiable collection here (beware of performance implications)- Specified by:
getSegments
in interfaceItemPath
- Specified by:
getSegments
in interfaceUniformItemPath
-
first
public ItemPathSegment first()
Description copied from interface:ItemPath
Returns the first segment or null if the path is empty.- Specified by:
first
in interfaceItemPath
- Specified by:
first
in interfaceUniformItemPath
-
rest
@NotNull public UniformItemPath rest()
Description copied from interface:ItemPath
Returns the rest of the path (the tail).- Specified by:
rest
in interfaceItemPath
- Specified by:
rest
in interfaceUniformItemPath
-
rest
@NotNull public UniformItemPath rest(int n)
Description copied from interface:ItemPath
Returns the rest of the path (the tail), starting at position "n".- Specified by:
rest
in interfaceItemPath
- Specified by:
rest
in interfaceUniformItemPath
-
tail
@NotNull public UniformItemPath tail(int n)
-
last
@Nullable public ItemPathSegment last()
Description copied from interface:ItemPath
Returns the last segment (or null if the path is empty).- Specified by:
last
in interfaceItemPath
- Specified by:
last
in interfaceUniformItemPath
-
firstAsPath
public UniformItemPath firstAsPath()
Description copied from interface:UniformItemPath
Returns first segment in a form of path.- Specified by:
firstAsPath
in interfaceItemPath
- Specified by:
firstAsPath
in interfaceUniformItemPath
-
allExceptLast
@NotNull public UniformItemPath allExceptLast()
Description copied from interface:UniformItemPath
Returns a path containing all segments except the last one.- Specified by:
allExceptLast
in interfaceItemPath
- Specified by:
allExceptLast
in interfaceUniformItemPath
-
allUpToLastName
@NotNull public UniformItemPath allUpToLastName()
Description copied from interface:UniformItemPath
Returns a path containing all segments up to (and not including) the last one.- Specified by:
allUpToLastName
in interfaceItemPath
- Specified by:
allUpToLastName
in interfaceUniformItemPath
-
allUpToIncluding
public UniformItemPath allUpToIncluding(int i)
Description copied from interface:ItemPath
Returns all segments up to the specified one (including it).- Specified by:
allUpToIncluding
in interfaceItemPath
- Specified by:
allUpToIncluding
in interfaceUniformItemPath
-
size
public int size()
Description copied from interface:ItemPath
Returns path size i.e. the number of components.
-
isEmpty
public boolean isEmpty()
Description copied from interface:ItemPath
Returns true if the path is empty i.e. has no components.
-
normalize
public UniformItemPathImpl normalize()
Makes the path "normal" by inserting null Id segments where they were omitted.- Specified by:
normalize
in interfaceUniformItemPath
-
removeIds
@NotNull public UniformItemPath removeIds()
Description copied from interface:ItemPath
Returns the path with no Id segments.- Specified by:
removeIds
in interfaceItemPath
- Specified by:
removeIds
in interfaceUniformItemPath
-
namedSegmentsOnly
@NotNull public UniformItemPath namedSegmentsOnly()
Description copied from interface:ItemPath
Returns the path containing only the regular named segments.- Specified by:
namedSegmentsOnly
in interfaceItemPath
- Specified by:
namedSegmentsOnly
in interfaceUniformItemPath
-
stripVariableSegment
@NotNull public UniformItemPath stripVariableSegment()
Description copied from interface:ItemPath
Removes the leading variable segment, if present.- Specified by:
stripVariableSegment
in interfaceItemPath
- Specified by:
stripVariableSegment
in interfaceUniformItemPath
-
append
public UniformItemPath append(QName childName)
-
remainder
public UniformItemPath remainder(ItemPath prefix)
Description copied from interface:ItemPath
Returns the remainder of "this" path after passing all segments from the other path. (I.e. this path must begin with the content of the other path. Throws an exception when it is not the case.)- Specified by:
remainder
in interfaceItemPath
- Specified by:
remainder
in interfaceUniformItemPath
-
equals
public boolean equals(Object obj)
More strict version of ItemPath comparison. Does not use any normalization nor approximate matching QNames via QNameUtil.match. For semantic-level comparison, please use equivalent(..) method.- Specified by:
equals
in interfaceUniformItemPath
- Overrides:
equals
in classObject
-
clone
public UniformItemPath clone()
- Specified by:
clone
in interfaceUniformItemPath
- Overrides:
clone
in classObject
-
asItemPathType
public ItemPathType asItemPathType()
- Specified by:
asItemPathType
in interfaceUniformItemPath
-
lastName
public ItemName lastName()
Description copied from interface:ItemPath
Returns the last name segment value; or null if there's no name segment.
-
subPath
public UniformItemPathImpl subPath(int from, int to)
Description copied from interface:ItemPath
Returns a sub-path from (including) to (excluding) given indices.
-
getSegment
public ItemPathSegment getSegment(int i)
Description copied from interface:ItemPath
Returns the given path segment.- Specified by:
getSegment
in interfaceItemPath
- Specified by:
getSegment
in interfaceUniformItemPath
-
-