@NotThreadSafe public static final class OAuthCredentials.Builder extends Object
OAuthCredentials.
Initialize attributes and then invoke the build() method to create an
immutable instance.
Builder is not thread-safe and generally should not be stored in a field or collection,
but instead used immediately to create instances.
| Modifier and Type | Method and Description |
|---|---|
OAuthCredentials |
build()
Builds a new
OAuthCredentials. |
OAuthCredentials.Builder |
from(OAuthCredentialsIF instance)
Fill a builder with attribute values from the provided
OAuthCredentialsIF instance. |
OAuthCredentials.Builder |
setAccessToken(String accessToken)
Initializes the value for the
accessToken attribute. |
OAuthCredentials.Builder |
setBot(BotCredentials bot)
Initializes the optional value
bot to bot. |
OAuthCredentials.Builder |
setBot(Optional<BotCredentials> bot)
Initializes the optional value
bot to bot. |
OAuthCredentials.Builder |
setIncomingWebhook(IncomingWebhook incomingWebhook)
Initializes the optional value
incomingWebhook to incomingWebhook. |
OAuthCredentials.Builder |
setIncomingWebhook(Optional<IncomingWebhook> incomingWebhook)
Initializes the optional value
incomingWebhook to incomingWebhook. |
OAuthCredentials.Builder |
setScope(Optional<String> scope)
Initializes the optional value
scope to scope. |
OAuthCredentials.Builder |
setScope(String scope)
Initializes the optional value
scope to scope. |
OAuthCredentials.Builder |
setTeamId(String teamId)
Initializes the value for the
teamId attribute. |
OAuthCredentials.Builder |
setTeamName(String teamName)
Initializes the value for the
teamName attribute. |
OAuthCredentials.Builder |
setUserId(Optional<String> userId)
Initializes the optional value
userId to userId. |
OAuthCredentials.Builder |
setUserId(String userId)
Initializes the optional value
userId to userId. |
public final OAuthCredentials.Builder from(OAuthCredentialsIF instance)
OAuthCredentialsIF instance.
Regular attribute values will be replaced with those from the given instance.
Absent optional values will not replace present values.instance - The instance from which to copy valuesthis builder for use in a chained invocationpublic final OAuthCredentials.Builder setAccessToken(String accessToken)
accessToken attribute.accessToken - The value for accessTokenthis builder for use in a chained invocationpublic final OAuthCredentials.Builder setTeamName(String teamName)
teamName attribute.teamName - The value for teamNamethis builder for use in a chained invocationpublic final OAuthCredentials.Builder setTeamId(String teamId)
teamId attribute.teamId - The value for teamIdthis builder for use in a chained invocationpublic final OAuthCredentials.Builder setScope(@Nullable String scope)
scope to scope.scope - The value for scope, null is accepted as java.util.Optional.empty()this builder for chained invocationpublic final OAuthCredentials.Builder setScope(Optional<String> scope)
scope to scope.scope - The value for scopethis builder for use in a chained invocationpublic final OAuthCredentials.Builder setUserId(@Nullable String userId)
userId to userId.userId - The value for userId, null is accepted as java.util.Optional.empty()this builder for chained invocationpublic final OAuthCredentials.Builder setUserId(Optional<String> userId)
userId to userId.userId - The value for userIdthis builder for use in a chained invocationpublic final OAuthCredentials.Builder setBot(@Nullable BotCredentials bot)
bot to bot.bot - The value for bot, null is accepted as java.util.Optional.empty()this builder for chained invocationpublic final OAuthCredentials.Builder setBot(Optional<BotCredentials> bot)
bot to bot.bot - The value for botthis builder for use in a chained invocationpublic final OAuthCredentials.Builder setIncomingWebhook(@Nullable IncomingWebhook incomingWebhook)
incomingWebhook to incomingWebhook.incomingWebhook - The value for incomingWebhook, null is accepted as java.util.Optional.empty()this builder for chained invocationpublic final OAuthCredentials.Builder setIncomingWebhook(Optional<IncomingWebhook> incomingWebhook)
incomingWebhook to incomingWebhook.incomingWebhook - The value for incomingWebhookthis builder for use in a chained invocationpublic OAuthCredentials build() throws com.hubspot.immutables.validation.InvalidImmutableStateException
OAuthCredentials.com.hubspot.immutables.validation.InvalidImmutableStateException - if any required attributes are missingCopyright © 2019. All rights reserved.