Class QueryParameter

java.lang.Object
org.springframework.hateoas.QueryParameter

public final class QueryParameter extends Object
Representation of a web request's query parameter (https://example.com?name=foo) => {"name", "foo", true}.
Author:
Greg Turnquist, Oliver Drotbohm
  • Method Details

    • of

      public static QueryParameter of(org.springframework.core.MethodParameter parameter)
      Creates a new QueryParameter from the given MethodParameter.
      Parameters:
      parameter - must not be null.
      Returns:
      will never be null.
    • required

      public static QueryParameter required(String name)
      Creates a new required QueryParameter with the given name;
      Parameters:
      name - must not be null or empty.
      Returns:
    • optional

      public static QueryParameter optional(String name)
      Creates a new optional QueryParameter with the given name;
      Parameters:
      name - must not be null or empty.
      Returns:
    • withValue

      public QueryParameter withValue(@Nullable String value)
      Create a new QueryParameter by copying all attributes and applying the new value.
      Parameters:
      value -
      Returns:
    • getName

      public String getName()
    • getValue

      public @Nullable String getValue()
    • isRequired

      public boolean isRequired()
    • equals

      public boolean equals(@Nullable Object o)
      Overrides:
      equals in class Object
    • hashCode

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

      public String toString()
      Overrides:
      toString in class Object