Class VariablePathSegment

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

public final class VariablePathSegment extends PathSegment
This segment matches any request path segment. The request handling logic will generate a PathArgument for each such segment.
  • Constructor Details

    • VariablePathSegment

      public VariablePathSegment(String variableName)
      Constructor.
      Parameters:
      variableName - the name of the variable. This is currently not used anywhere. It is usually specified by providing the whole path pattern as a string-based specification that contains variable path segments as :name which contains the variable name.
  • Method Details

    • getVariableName

      public String getVariableName()
      Getter for the variable name
      Returns:
      the variable name (currently not used anywhere)
    • 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