Package io.grpc
Class QueryParams.Entry
- java.lang.Object
-
- io.grpc.QueryParams.Entry
-
- Enclosing class:
- QueryParams
public static final class QueryParams.Entry extends Object
A single query parameter entry.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object o)static QueryParams.EntryforKeyValue(String key, String value)Creates a new key/value pair entry.static QueryParams.EntryforLoneKey(String key)Creates a new query parameter with a "lone" key.StringgetKey()Returns the key.StringgetValue()Returns the value, ornullif this is a "lone" key.inthashCode()booleanhasValue()Returnstrueif this entry has a value,falseif it is a "lone" key.StringtoString()
-
-
-
Method Detail
-
getKey
public String getKey()
Returns the key.Any characters that needed URL encoding have already been decoded.
-
getValue
@Nullable public String getValue()
Returns the value, ornullif this is a "lone" key.Any characters that needed URL encoding have already been decoded.
-
hasValue
public boolean hasValue()
Returnstrueif this entry has a value,falseif it is a "lone" key.
-
forKeyValue
public static QueryParams.Entry forKeyValue(String key, String value)
Creates a new key/value pair entry.Both key and value can contain any character. They will be URL encoded for you if necessary.
-
forLoneKey
public static QueryParams.Entry forLoneKey(String key)
Creates a new query parameter with a "lone" key.'key' can contain any character. It will be URL encoded for you later, as necessary.
- Parameters:
key- the decoded key, must not be null- Returns:
- a new
Entry
-
-