Class Zulip.Builder
java.lang.Object
com.github.jamesnetherton.zulip.client.Zulip.Builder
- Enclosing class:
Zulip
Builder class for constructing the Zulip Client.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionSets the Zulip API key to use for authentication with the Zulip server.build()
Builds a newZulip
instance.Sets the Zulip email address to use for authentication with the Zulip server.httpClientFactory
(ZulipHttpClientFactory httpClientFactory) Sets a customZulipHttpClientFactory
to enable the Zulip client to use an HTTP client other than the default Apache Commons HTTP client.insecure
(boolean insecure) Sets whether the Zulip HTTP client should ignore SSL certificate validation errors.proxyPassword
(String proxyPassword) Sets the proxy server password that the Zulip HTTP client should use when making requests to the Zulip server.Sets the proxy server URL that the Zulip HTTP client should use when making requests to the Zulip server.proxyUsername
(String proxyUsername) Sets the proxy server user name that the Zulip HTTP client should use when making requests to the Zulip server.Sets the URL of the Zulip server.
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
apiKey
Sets the Zulip API key to use for authentication with the Zulip server.- Parameters:
apiKey
- The user API key- Returns:
- This
Zulip.Builder
object - See Also:
-
email
Sets the Zulip email address to use for authentication with the Zulip server.- Parameters:
email
- The user email address- Returns:
- This
Zulip.Builder
object
-
httpClientFactory
Sets a customZulipHttpClientFactory
to enable the Zulip client to use an HTTP client other than the default Apache Commons HTTP client.- Parameters:
httpClientFactory
- TheZulipHttpClientFactory
implementation- Returns:
- This
Zulip.Builder
object
-
insecure
Sets whether the Zulip HTTP client should ignore SSL certificate validation errors. This is not recommended for production use.- Parameters:
insecure
-true
if unknown certificates should be trusted.false
to not trust unknown certificates and to receive an exception- Returns:
- This
Zulip.Builder
object
-
proxyUrl
Sets the proxy server URL that the Zulip HTTP client should use when making requests to the Zulip server.- Parameters:
proxyUrl
- The proxy server URL- Returns:
- This
Zulip.Builder
object
-
proxyUsername
Sets the proxy server user name that the Zulip HTTP client should use when making requests to the Zulip server.- Parameters:
proxyUsername
- The proxy server username- Returns:
- This
Zulip.Builder
object
-
proxyPassword
Sets the proxy server password that the Zulip HTTP client should use when making requests to the Zulip server.- Parameters:
proxyPassword
- The proxy server password- Returns:
- This
Zulip.Builder
object
-
site
Sets the URL of the Zulip server.- Parameters:
site
- The URL of the Zulip server. Note this should be without the /api/v1 suffix.- Returns:
- This
Zulip.Builder
object
-
build
Builds a newZulip
instance.- Returns:
- A new
Zulip
client object - Throws:
ZulipClientException
-