Class 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
    • Method Detail

      • 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.
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object