Class URLParameter

java.lang.Object
com.helger.commons.url.URLParameter

@Immutable public class URLParameter extends Object
This class represents a single URL parameter. It consists of a mandatory name and an optional value.
Author:
Philip Helger
  • Constructor Details

  • Method Details

    • getName

      @Nonnull @Nonempty public String getName()
      Returns:
      The name of the URL parameter. Neither null nor empty.
    • hasName

      public boolean hasName(@Nullable String sName)
      Check if this parameter has the specified name.
      Parameters:
      sName - The name to check. May be null.
      Returns:
      true if name matches, false otherwise.
    • getValue

      @Nonnull public String getValue()
      Returns:
      The value of the URL parameter. Never null but maybe empty.
    • hasValue

      public boolean hasValue()
      Returns:
      true if this parameter has a value, false otherwise.
    • hasValue

      public boolean hasValue(@Nullable String sValue)
      Check if this parameter has the specified value.
      Parameters:
      sValue - The value to check. May be null.
      Returns:
      true if value matches, false otherwise.
    • appendTo

      public void appendTo(@Nonnull StringBuilder aSB, @Nullable IEncoder<String,String> aQueryParameterEncoder)
    • equals

      public boolean equals(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