public class D1Url extends Object
Constructor and Description |
---|
D1Url() |
D1Url(String baseUrl) |
D1Url(String baseUrl,
String resource) |
Modifier and Type | Method and Description |
---|---|
void |
addDateParamPair(String key,
Date dateLocalTime)
convenience method for adding date object to query parameters.
|
void |
addNextPathElement(String pathElement)
adds the next path element to the path portion of the URL, encoding unsafe characters.
|
void |
addNonEmptyParam(String param)
adds a single parameter to the query portion of the URL (not a key-value pair)
encoding unsafe characters.
|
void |
addNonEmptyParamPair(String key,
Integer integer)
adds a key value pair to the query portion of the URL, placing '=' character between them,
and encoding unsafe characters.
|
void |
addNonEmptyParamPair(String key,
String value)
adds a key value pair to the query portion of the URL, placing '=' character between them,
and encoding unsafe characters.
|
void |
addPreEncodedNonEmptyQueryParams(String param)
Method for adding query params that bypasses encoding.
|
protected void |
assembleUrl() |
String |
getAssembledQueryString() |
String |
getBaseUrl() |
String |
getResource() |
String |
getUrl() |
protected String |
joinToUrlWith(String joiner,
String string)
use this method to avoid inadvertent duplication of the joining character
The most common case is when a baseUrl contains a trailing slash and you
want to append another path elements.
|
void |
setBaseUrl(String baseUrl) |
void |
setResource(String res) |
String |
toString() |
protected static String |
trimAndValidateString(String s) |
public D1Url(String baseUrl, String resource) throws IllegalArgumentException
IllegalArgumentException
public D1Url(String baseUrl) throws IllegalArgumentException
IllegalArgumentException
public D1Url()
public void setBaseUrl(String baseUrl) throws IllegalArgumentException
IllegalArgumentException
public String getBaseUrl()
public void setResource(String res)
public String getResource()
public void addNextPathElement(String pathElement) throws IllegalArgumentException
pathElement
- IllegalArgumentException
- - if pathElement is null or emptypublic void addNonEmptyParam(String param)
param
- public void addNonEmptyParamPair(String key, String value)
key
- value
- public void addDateParamPair(String key, Date dateLocalTime)
key
- date
- IllegalArgumentException
public void addNonEmptyParamPair(String key, Integer integer)
key
- integer
- public void addPreEncodedNonEmptyQueryParams(String param)
param
- public String getUrl()
protected void assembleUrl()
public String getAssembledQueryString()
protected static String trimAndValidateString(String s) throws IllegalArgumentException
IllegalArgumentException
Copyright © 2020. All Rights Reserved.