- Enclosing class:
- Configuration
public static class Configuration.Builder
extends java.lang.Object
To use this, call Configuration.Builder.create() then chain one or more builder methods.
The only required method is withCredentials(String, String).
-
Method Summary
Modifier and Type Method Description Configurationbuild()Creates a Configuration instance.static ConfigurationbuildDefault(java.lang.String username, java.lang.String password)Creates a new configuration instance using default values (default host and no proxy).static Configuration.Buildercreate()Configuration.BuilderwithCredentials(java.lang.String username, java.lang.String password)Set a username and password to authenticate against the APIConfiguration.BuilderwithHost(java.lang.String host)Allow you to define a hostname that the client will use.Configuration.BuilderwithProxy(java.net.Proxy proxy)Allow you to define a proxy (if it is required by your organisation).
-
Method Details
-
create
-
withCredentials
Set a username and password to authenticate against the APIThis was provided to you by Commuty.
- Parameters:
username- The username Commuty provided to you.password- The password Commuty provided to you.- Returns:
- this builder instance.
-
withHost
Allow you to define a hostname that the client will use.
If you do not call this method, the client will use the default production parking api of Commuty.
Unless the Commuty Team tells you otherwise, you don't need to use this method.
- Parameters:
host- a valid URL- Returns:
- this builder instance.
-
withProxy
Allow you to define a proxy (if it is required by your organisation).
Pass a proxy instance to the method, i.e:
new Proxy(Proxy.Type.HTTP, new InetSocketAddress("10.0.0.1", 8080));- Parameters:
proxy- a validProxyobject.- Returns:
- this builder instance.
-
build
Creates a Configuration instance.- Returns:
- a new Configuration that will allow you to create a Rest client.
-
buildDefault
Creates a new configuration instance using default values (default host and no proxy).
In most cases, you will need only this method to create a Configuration object.
- Parameters:
username- The username Commuty provided to you.password- The password Commuty provided to you.- Returns:
- a new Configuration that will allow you to create a Rest client.
-