Class LiteralPathSegment

java.lang.Object
io.github.grumpystuff.grumpyrest.request.path.PathSegment
io.github.grumpystuff.grumpyrest.request.path.LiteralPathSegment

public final class LiteralPathSegment extends PathSegment
This segment only matches a request path segment with the exact same text.
  • Constructor Details

    • LiteralPathSegment

      public LiteralPathSegment(String text)
      Constructor.
      Parameters:
      text - the expected text for the request path segment
  • Method Details

    • getText

      public String getText()
      Getter method for the segment text
      Returns:
      the text
    • matches

      public boolean matches(String segment)
      Description copied from class: PathSegment
      Checks whether this segment matches a segment of a path from an incoming request.
      Specified by:
      matches in class PathSegment
      Parameters:
      segment - the request path segment
      Returns:
      true if the segment matches, false if not
    • toString

      public String toString()
      Overrides:
      toString in class Object