net.degreedays.api.processing
Class HttpRequest.Builder
java.lang.Object
net.degreedays.api.processing.HttpRequest.Builder
- Enclosing class:
- HttpRequest
public static final class HttpRequest.Builder
- extends java.lang.Object
A builder class for creating immutable HttpRequest
objects.
Instances of this builder class are designed for single-threaded use only. It's fine to create and use instances in multiple concurrent threads, but, in the absence of external synchronization, the use of each individual builder instance should be restricted to one thread only.
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
HttpRequest.Builder
public HttpRequest.Builder()
setUrl
public HttpRequest.Builder setUrl(java.lang.String url)
addParam
public HttpRequest.Builder addParam(java.lang.String paramName,
java.lang.String paramValueNotUrlEncoded)
- Add a new parameter.
Parameters with multiple values are not supported.
- Parameters:
paramName
- the non-null, non-empty name of the parameter to
add.paramValueNotUrlEncoded
- the non-null parameter value to add.
This should not be URL encoded.
- Returns:
this
, for method chaining.
- Throws:
java.lang.NullPointerException
- if paramName
or
paramValueNotUrlEncoded
is null
.
java.lang.IllegalArgumentException
- if paramName
is the
empty string, or if a value for paramName
has
already been added.
build
public HttpRequest build()
www.degreedays.net/api/