Package kong.unirest.core
Class Path
java.lang.Object
kong.unirest.core.Path
Class for building a URI with query params
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbaseUrl()
private String
encodePath
(String value) boolean
private String
int
hashCode()
void
replace a single path param by namevoid
replace path params designated with curley braces with a valuevoid
queryString
(String name, Object value) Add a query paramvoid
queryString
(String name, Collection<?> value) Add a query param.void
queryString
(Map<String, Object> parameters) Add query params as a map of key/valuesrawPath()
toString()
-
Field Details
-
url
-
rawPath
-
-
Constructor Details
-
Path
construct a path- Parameters:
url
- the URL
-
Path
Construct a path with a URL that could be relative and a default base for it- Parameters:
url
- the urldefaultBasePath
- the default base
-
-
Method Details
-
param
replace path params designated with curley braces with a value- Parameters:
params
- a map of param names and values
-
param
replace a single path param by name- Parameters:
name
- the name of the path paramvalue
- the value to replace it with
-
encodePath
-
queryString
Add a query param. This will result in a query param per value- Parameters:
name
- the namevalue
- a collection of values
-
queryString
Add a query param- Parameters:
name
- the namevalue
- the value
-
queryString
Add query params as a map of key/values- Parameters:
parameters
- the params to add
-
toString
-
escape
-
rawPath
- Returns:
- the full raw path
-
baseUrl
- Returns:
- the URL without the query string
-
getQueryString
- Returns:
- just the query string
-
equals
-
hashCode
public int hashCode()
-