Class Paths.SingleSegmentPath

java.lang.Object
io.debezium.document.Paths.SingleSegmentPath
All Implemented Interfaces:
Path, Paths.InnerPath, Iterable<String>
Enclosing class:
Paths

static final class Paths.SingleSegmentPath extends Object implements Path, Paths.InnerPath
  • Field Details

  • Constructor Details

    • SingleSegmentPath

      protected SingleSegmentPath(String segment)
  • Method Details

    • parent

      public Optional<Path> parent()
      Description copied from interface: Path
      Get the optional parent path.
      Specified by:
      parent in interface Path
      Returns:
      an optional containing the parent (if this is not the root path), or an empty optional if this is the root path.
    • lastSegment

      public Optional<String> lastSegment()
      Description copied from interface: Path
      Get the last segment, if there is one.
      Specified by:
      lastSegment in interface Path
      Returns:
      an optional containing the last segment of this path (if this is not the root path), or an empty optional if this is the root path.
    • size

      public int size()
      Description copied from interface: Path
      Get the number of segments in the path.
      Specified by:
      size in interface Path
      Returns:
      the size of the path; never negative
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • toRelativePath

      public String toRelativePath()
      Description copied from interface: Path
      Obtain the representation of this path as a relative path without the leading '/'.
      Specified by:
      toRelativePath in interface Path
      Returns:
      the relative path; never null but may be empty
    • iterator

      public Iterator<String> iterator()
      Specified by:
      iterator in interface Iterable<String>
    • forEach

      public void forEach(Consumer<? super String> consumer)
      Specified by:
      forEach in interface Iterable<String>
    • subpath

      public Path subpath(int length)
      Description copied from interface: Path
      Get a portion of this path that has a specified number of segments.
      Specified by:
      subpath in interface Path
      Parameters:
      length - the number of segments
      Returns:
      the subpath, or this path if the supplied length is equal to this.size()
    • segment

      public String segment(int index)
      Description copied from interface: Path
      Get the segment at the given index.
      Specified by:
      segment in interface Path
      Parameters:
      index - the index of the segment
      Returns:
      the segment
    • append

      public Path append(Path relPath)
      Description copied from interface: Path
      Create a new path consisting of this path appended with the given path that will be treated as a relative path.
      Specified by:
      append in interface Path
      Parameters:
      relPath - the relative path to be appended to this path; may not be null
      Returns:
      the new path
    • copyInto

      public int copyInto(String[] segments, int start)
      Specified by:
      copyInto in interface Paths.InnerPath