Package com.helger.commons.url
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 Summary
Constructors Constructor Description URLParameter(String sName)URLParameter(String sName, String sValue)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidappendTo(StringBuilder aSB, IEncoder<String,String> aQueryParameterEncoder)booleanequals(Object o)StringgetName()StringgetValue()inthashCode()booleanhasName(String sName)Check if this parameter has the specified name.booleanhasValue()booleanhasValue(String sValue)Check if this parameter has the specified value.StringtoString()
-
-
-
Method Detail
-
getName
@Nonnull @Nonempty public String getName()
- Returns:
- The name of the URL parameter. Neither
nullnor empty.
-
hasName
public boolean hasName(@Nullable String sName)
Check if this parameter has the specified name.- Parameters:
sName- The name to check. May benull.- Returns:
trueif name matches,falseotherwise.
-
getValue
@Nonnull public String getValue()
- Returns:
- The value of the URL parameter. Never
nullbut maybe empty.
-
hasValue
public boolean hasValue()
- Returns:
trueif this parameter has a value,falseotherwise.
-
hasValue
public boolean hasValue(@Nullable String sValue)
Check if this parameter has the specified value.- Parameters:
sValue- The value to check. May benull.- Returns:
trueif value matches,falseotherwise.
-
appendTo
public void appendTo(@Nonnull StringBuilder aSB, @Nullable IEncoder<String,String> aQueryParameterEncoder)
-
-