Interface IPathSegment
-
- All Known Subinterfaces:
IAssemblyNodeItem
,ICycledAssemblyNodeItem
,IDefinitionNodeItem<D,I>
,IDocumentNodeItem
,IFieldNodeItem
,IFlagNodeItem
,IModelNodeItem<D,I>
,IModuleNodeItem
,INodeItem
,IRootAssemblyNodeItem
public interface IPathSegment
A named segment of a path that can be formatted.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description String
format(IPathFormatter formatter)
Apply formatting for the path segment.INodeItem
getNodeItem()
Get the value associated with the path segment.default List<IPathSegment>
getPath()
Get a list of path segments, starting at the root and descending.Stream<? extends IPathSegment>
getPathStream()
Get a stream of path segments, starting at the root and descending.default String
toPath(IPathFormatter formatter)
Get the path for this node item using the provided formatter.
-
-
-
Method Detail
-
toPath
@NonNull default String toPath(@NonNull IPathFormatter formatter)
Get the path for this node item using the provided formatter.- Parameters:
formatter
- the path formatter to use to produce the path- Returns:
- the formatted path
-
format
@NonNull String format(@NonNull IPathFormatter formatter)
Apply formatting for the path segment. This is a visitor pattern that will be called to format each segment in a larger path.- Parameters:
formatter
- the path formatter- Returns:
- a textual representation of the path segment
-
getPath
@NonNull default List<IPathSegment> getPath()
Get a list of path segments, starting at the root and descending.- Returns:
- a list of path segments in descending order
-
getPathStream
@NonNull Stream<? extends IPathSegment> getPathStream()
Get a stream of path segments, starting at the root and descending.- Returns:
- a stream of path segments in descending order
-
getNodeItem
INodeItem getNodeItem()
Get the value associated with the path segment.- Returns:
- the value or if no value is associated with this path segment
-
-