io.thestencil.iam.api.ImmutableUserActionsClientConfig Maven / Gradle / Ivy
package io.thestencil.iam.api;
import com.google.common.base.MoreObjects;
import com.google.errorprone.annotations.CanIgnoreReturnValue;
import com.google.errorprone.annotations.Var;
import io.vertx.mutiny.ext.web.client.WebClient;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import javax.annotation.CheckReturnValue;
import javax.annotation.Nullable;
import javax.annotation.ParametersAreNonnullByDefault;
import javax.annotation.concurrent.Immutable;
import javax.annotation.concurrent.NotThreadSafe;
import org.immutables.value.Generated;
/**
* Immutable implementation of {@link UserActionsClient.UserActionsClientConfig}.
*
* Use the builder to create immutable instances:
* {@code ImmutableUserActionsClientConfig.builder()}.
*/
@Generated(from = "UserActionsClient.UserActionsClientConfig", generator = "Immutables")
@SuppressWarnings({"all"})
@ParametersAreNonnullByDefault
@javax.annotation.processing.Generated("org.immutables.processor.ProxyProcessor")
@Immutable
@CheckReturnValue
public final class ImmutableUserActionsClientConfig
implements UserActionsClient.UserActionsClientConfig {
private final WebClient webClient;
private final String defaultLanguage;
private final String servicePath;
private final String fillPath;
private final String reviewPath;
private final String messagesPath;
private final String attachmentsPath;
private final String authorizationsPath;
private final @Nullable RemoteIntegration attachments;
private final @Nullable RemoteIntegration fill;
private final @Nullable RemoteIntegration review;
private final @Nullable RemoteIntegration replyTo;
private final RemoteIntegration processes;
private ImmutableUserActionsClientConfig(
WebClient webClient,
String defaultLanguage,
String servicePath,
String fillPath,
String reviewPath,
String messagesPath,
String attachmentsPath,
String authorizationsPath,
@Nullable RemoteIntegration attachments,
@Nullable RemoteIntegration fill,
@Nullable RemoteIntegration review,
@Nullable RemoteIntegration replyTo,
RemoteIntegration processes) {
this.webClient = webClient;
this.defaultLanguage = defaultLanguage;
this.servicePath = servicePath;
this.fillPath = fillPath;
this.reviewPath = reviewPath;
this.messagesPath = messagesPath;
this.attachmentsPath = attachmentsPath;
this.authorizationsPath = authorizationsPath;
this.attachments = attachments;
this.fill = fill;
this.review = review;
this.replyTo = replyTo;
this.processes = processes;
}
/**
* @return The value of the {@code webClient} attribute
*/
@Override
public WebClient getWebClient() {
return webClient;
}
/**
* @return The value of the {@code defaultLanguage} attribute
*/
@Override
public String getDefaultLanguage() {
return defaultLanguage;
}
/**
* @return The value of the {@code servicePath} attribute
*/
@Override
public String getServicePath() {
return servicePath;
}
/**
* @return The value of the {@code fillPath} attribute
*/
@Override
public String getFillPath() {
return fillPath;
}
/**
* @return The value of the {@code reviewPath} attribute
*/
@Override
public String getReviewPath() {
return reviewPath;
}
/**
* @return The value of the {@code messagesPath} attribute
*/
@Override
public String getMessagesPath() {
return messagesPath;
}
/**
* @return The value of the {@code attachmentsPath} attribute
*/
@Override
public String getAttachmentsPath() {
return attachmentsPath;
}
/**
* @return The value of the {@code authorizationsPath} attribute
*/
@Override
public String getAuthorizationsPath() {
return authorizationsPath;
}
/**
* @return The value of the {@code attachments} attribute
*/
@Override
public @Nullable RemoteIntegration getAttachments() {
return attachments;
}
/**
* @return The value of the {@code fill} attribute
*/
@Override
public @Nullable RemoteIntegration getFill() {
return fill;
}
/**
* @return The value of the {@code review} attribute
*/
@Override
public @Nullable RemoteIntegration getReview() {
return review;
}
/**
* @return The value of the {@code replyTo} attribute
*/
@Override
public @Nullable RemoteIntegration getReplyTo() {
return replyTo;
}
/**
* @return The value of the {@code processes} attribute
*/
@Override
public RemoteIntegration getProcesses() {
return processes;
}
/**
* Copy the current immutable object by setting a value for the {@link UserActionsClient.UserActionsClientConfig#getWebClient() webClient} attribute.
* A shallow reference equality check is used to prevent copying of the same value by returning {@code this}.
* @param value A new value for webClient
* @return A modified copy of the {@code this} object
*/
public final ImmutableUserActionsClientConfig withWebClient(WebClient value) {
if (this.webClient == value) return this;
WebClient newValue = Objects.requireNonNull(value, "webClient");
return new ImmutableUserActionsClientConfig(
newValue,
this.defaultLanguage,
this.servicePath,
this.fillPath,
this.reviewPath,
this.messagesPath,
this.attachmentsPath,
this.authorizationsPath,
this.attachments,
this.fill,
this.review,
this.replyTo,
this.processes);
}
/**
* Copy the current immutable object by setting a value for the {@link UserActionsClient.UserActionsClientConfig#getDefaultLanguage() defaultLanguage} attribute.
* An equals check used to prevent copying of the same value by returning {@code this}.
* @param value A new value for defaultLanguage
* @return A modified copy of the {@code this} object
*/
public final ImmutableUserActionsClientConfig withDefaultLanguage(String value) {
String newValue = Objects.requireNonNull(value, "defaultLanguage");
if (this.defaultLanguage.equals(newValue)) return this;
return new ImmutableUserActionsClientConfig(
this.webClient,
newValue,
this.servicePath,
this.fillPath,
this.reviewPath,
this.messagesPath,
this.attachmentsPath,
this.authorizationsPath,
this.attachments,
this.fill,
this.review,
this.replyTo,
this.processes);
}
/**
* Copy the current immutable object by setting a value for the {@link UserActionsClient.UserActionsClientConfig#getServicePath() servicePath} attribute.
* An equals check used to prevent copying of the same value by returning {@code this}.
* @param value A new value for servicePath
* @return A modified copy of the {@code this} object
*/
public final ImmutableUserActionsClientConfig withServicePath(String value) {
String newValue = Objects.requireNonNull(value, "servicePath");
if (this.servicePath.equals(newValue)) return this;
return new ImmutableUserActionsClientConfig(
this.webClient,
this.defaultLanguage,
newValue,
this.fillPath,
this.reviewPath,
this.messagesPath,
this.attachmentsPath,
this.authorizationsPath,
this.attachments,
this.fill,
this.review,
this.replyTo,
this.processes);
}
/**
* Copy the current immutable object by setting a value for the {@link UserActionsClient.UserActionsClientConfig#getFillPath() fillPath} attribute.
* An equals check used to prevent copying of the same value by returning {@code this}.
* @param value A new value for fillPath
* @return A modified copy of the {@code this} object
*/
public final ImmutableUserActionsClientConfig withFillPath(String value) {
String newValue = Objects.requireNonNull(value, "fillPath");
if (this.fillPath.equals(newValue)) return this;
return new ImmutableUserActionsClientConfig(
this.webClient,
this.defaultLanguage,
this.servicePath,
newValue,
this.reviewPath,
this.messagesPath,
this.attachmentsPath,
this.authorizationsPath,
this.attachments,
this.fill,
this.review,
this.replyTo,
this.processes);
}
/**
* Copy the current immutable object by setting a value for the {@link UserActionsClient.UserActionsClientConfig#getReviewPath() reviewPath} attribute.
* An equals check used to prevent copying of the same value by returning {@code this}.
* @param value A new value for reviewPath
* @return A modified copy of the {@code this} object
*/
public final ImmutableUserActionsClientConfig withReviewPath(String value) {
String newValue = Objects.requireNonNull(value, "reviewPath");
if (this.reviewPath.equals(newValue)) return this;
return new ImmutableUserActionsClientConfig(
this.webClient,
this.defaultLanguage,
this.servicePath,
this.fillPath,
newValue,
this.messagesPath,
this.attachmentsPath,
this.authorizationsPath,
this.attachments,
this.fill,
this.review,
this.replyTo,
this.processes);
}
/**
* Copy the current immutable object by setting a value for the {@link UserActionsClient.UserActionsClientConfig#getMessagesPath() messagesPath} attribute.
* An equals check used to prevent copying of the same value by returning {@code this}.
* @param value A new value for messagesPath
* @return A modified copy of the {@code this} object
*/
public final ImmutableUserActionsClientConfig withMessagesPath(String value) {
String newValue = Objects.requireNonNull(value, "messagesPath");
if (this.messagesPath.equals(newValue)) return this;
return new ImmutableUserActionsClientConfig(
this.webClient,
this.defaultLanguage,
this.servicePath,
this.fillPath,
this.reviewPath,
newValue,
this.attachmentsPath,
this.authorizationsPath,
this.attachments,
this.fill,
this.review,
this.replyTo,
this.processes);
}
/**
* Copy the current immutable object by setting a value for the {@link UserActionsClient.UserActionsClientConfig#getAttachmentsPath() attachmentsPath} attribute.
* An equals check used to prevent copying of the same value by returning {@code this}.
* @param value A new value for attachmentsPath
* @return A modified copy of the {@code this} object
*/
public final ImmutableUserActionsClientConfig withAttachmentsPath(String value) {
String newValue = Objects.requireNonNull(value, "attachmentsPath");
if (this.attachmentsPath.equals(newValue)) return this;
return new ImmutableUserActionsClientConfig(
this.webClient,
this.defaultLanguage,
this.servicePath,
this.fillPath,
this.reviewPath,
this.messagesPath,
newValue,
this.authorizationsPath,
this.attachments,
this.fill,
this.review,
this.replyTo,
this.processes);
}
/**
* Copy the current immutable object by setting a value for the {@link UserActionsClient.UserActionsClientConfig#getAuthorizationsPath() authorizationsPath} attribute.
* An equals check used to prevent copying of the same value by returning {@code this}.
* @param value A new value for authorizationsPath
* @return A modified copy of the {@code this} object
*/
public final ImmutableUserActionsClientConfig withAuthorizationsPath(String value) {
String newValue = Objects.requireNonNull(value, "authorizationsPath");
if (this.authorizationsPath.equals(newValue)) return this;
return new ImmutableUserActionsClientConfig(
this.webClient,
this.defaultLanguage,
this.servicePath,
this.fillPath,
this.reviewPath,
this.messagesPath,
this.attachmentsPath,
newValue,
this.attachments,
this.fill,
this.review,
this.replyTo,
this.processes);
}
/**
* Copy the current immutable object by setting a value for the {@link UserActionsClient.UserActionsClientConfig#getAttachments() attachments} attribute.
* A shallow reference equality check is used to prevent copying of the same value by returning {@code this}.
* @param value A new value for attachments (can be {@code null})
* @return A modified copy of the {@code this} object
*/
public final ImmutableUserActionsClientConfig withAttachments(@Nullable RemoteIntegration value) {
if (this.attachments == value) return this;
return new ImmutableUserActionsClientConfig(
this.webClient,
this.defaultLanguage,
this.servicePath,
this.fillPath,
this.reviewPath,
this.messagesPath,
this.attachmentsPath,
this.authorizationsPath,
value,
this.fill,
this.review,
this.replyTo,
this.processes);
}
/**
* Copy the current immutable object by setting a value for the {@link UserActionsClient.UserActionsClientConfig#getFill() fill} attribute.
* A shallow reference equality check is used to prevent copying of the same value by returning {@code this}.
* @param value A new value for fill (can be {@code null})
* @return A modified copy of the {@code this} object
*/
public final ImmutableUserActionsClientConfig withFill(@Nullable RemoteIntegration value) {
if (this.fill == value) return this;
return new ImmutableUserActionsClientConfig(
this.webClient,
this.defaultLanguage,
this.servicePath,
this.fillPath,
this.reviewPath,
this.messagesPath,
this.attachmentsPath,
this.authorizationsPath,
this.attachments,
value,
this.review,
this.replyTo,
this.processes);
}
/**
* Copy the current immutable object by setting a value for the {@link UserActionsClient.UserActionsClientConfig#getReview() review} attribute.
* A shallow reference equality check is used to prevent copying of the same value by returning {@code this}.
* @param value A new value for review (can be {@code null})
* @return A modified copy of the {@code this} object
*/
public final ImmutableUserActionsClientConfig withReview(@Nullable RemoteIntegration value) {
if (this.review == value) return this;
return new ImmutableUserActionsClientConfig(
this.webClient,
this.defaultLanguage,
this.servicePath,
this.fillPath,
this.reviewPath,
this.messagesPath,
this.attachmentsPath,
this.authorizationsPath,
this.attachments,
this.fill,
value,
this.replyTo,
this.processes);
}
/**
* Copy the current immutable object by setting a value for the {@link UserActionsClient.UserActionsClientConfig#getReplyTo() replyTo} attribute.
* A shallow reference equality check is used to prevent copying of the same value by returning {@code this}.
* @param value A new value for replyTo (can be {@code null})
* @return A modified copy of the {@code this} object
*/
public final ImmutableUserActionsClientConfig withReplyTo(@Nullable RemoteIntegration value) {
if (this.replyTo == value) return this;
return new ImmutableUserActionsClientConfig(
this.webClient,
this.defaultLanguage,
this.servicePath,
this.fillPath,
this.reviewPath,
this.messagesPath,
this.attachmentsPath,
this.authorizationsPath,
this.attachments,
this.fill,
this.review,
value,
this.processes);
}
/**
* Copy the current immutable object by setting a value for the {@link UserActionsClient.UserActionsClientConfig#getProcesses() processes} attribute.
* A shallow reference equality check is used to prevent copying of the same value by returning {@code this}.
* @param value A new value for processes
* @return A modified copy of the {@code this} object
*/
public final ImmutableUserActionsClientConfig withProcesses(RemoteIntegration value) {
if (this.processes == value) return this;
RemoteIntegration newValue = Objects.requireNonNull(value, "processes");
return new ImmutableUserActionsClientConfig(
this.webClient,
this.defaultLanguage,
this.servicePath,
this.fillPath,
this.reviewPath,
this.messagesPath,
this.attachmentsPath,
this.authorizationsPath,
this.attachments,
this.fill,
this.review,
this.replyTo,
newValue);
}
/**
* This instance is equal to all instances of {@code ImmutableUserActionsClientConfig} that have equal attribute values.
* @return {@code true} if {@code this} is equal to {@code another} instance
*/
@Override
public boolean equals(@Nullable Object another) {
if (this == another) return true;
return another instanceof ImmutableUserActionsClientConfig
&& equalTo((ImmutableUserActionsClientConfig) another);
}
private boolean equalTo(ImmutableUserActionsClientConfig another) {
return webClient.equals(another.webClient)
&& defaultLanguage.equals(another.defaultLanguage)
&& servicePath.equals(another.servicePath)
&& fillPath.equals(another.fillPath)
&& reviewPath.equals(another.reviewPath)
&& messagesPath.equals(another.messagesPath)
&& attachmentsPath.equals(another.attachmentsPath)
&& authorizationsPath.equals(another.authorizationsPath)
&& Objects.equals(attachments, another.attachments)
&& Objects.equals(fill, another.fill)
&& Objects.equals(review, another.review)
&& Objects.equals(replyTo, another.replyTo)
&& processes.equals(another.processes);
}
/**
* Computes a hash code from attributes: {@code webClient}, {@code defaultLanguage}, {@code servicePath}, {@code fillPath}, {@code reviewPath}, {@code messagesPath}, {@code attachmentsPath}, {@code authorizationsPath}, {@code attachments}, {@code fill}, {@code review}, {@code replyTo}, {@code processes}.
* @return hashCode value
*/
@Override
public int hashCode() {
@Var int h = 5381;
h += (h << 5) + webClient.hashCode();
h += (h << 5) + defaultLanguage.hashCode();
h += (h << 5) + servicePath.hashCode();
h += (h << 5) + fillPath.hashCode();
h += (h << 5) + reviewPath.hashCode();
h += (h << 5) + messagesPath.hashCode();
h += (h << 5) + attachmentsPath.hashCode();
h += (h << 5) + authorizationsPath.hashCode();
h += (h << 5) + Objects.hashCode(attachments);
h += (h << 5) + Objects.hashCode(fill);
h += (h << 5) + Objects.hashCode(review);
h += (h << 5) + Objects.hashCode(replyTo);
h += (h << 5) + processes.hashCode();
return h;
}
/**
* Prints the immutable value {@code UserActionsClientConfig} with attribute values.
* @return A string representation of the value
*/
@Override
public String toString() {
return MoreObjects.toStringHelper("UserActionsClientConfig")
.omitNullValues()
.add("webClient", webClient)
.add("defaultLanguage", defaultLanguage)
.add("servicePath", servicePath)
.add("fillPath", fillPath)
.add("reviewPath", reviewPath)
.add("messagesPath", messagesPath)
.add("attachmentsPath", attachmentsPath)
.add("authorizationsPath", authorizationsPath)
.add("attachments", attachments)
.add("fill", fill)
.add("review", review)
.add("replyTo", replyTo)
.add("processes", processes)
.toString();
}
/**
* Creates an immutable copy of a {@link UserActionsClient.UserActionsClientConfig} value.
* Uses accessors to get values to initialize the new immutable instance.
* If an instance is already immutable, it is returned as is.
* @param instance The instance to copy
* @return A copied immutable UserActionsClientConfig instance
*/
public static ImmutableUserActionsClientConfig copyOf(UserActionsClient.UserActionsClientConfig instance) {
if (instance instanceof ImmutableUserActionsClientConfig) {
return (ImmutableUserActionsClientConfig) instance;
}
return ImmutableUserActionsClientConfig.builder()
.from(instance)
.build();
}
/**
* Creates a builder for {@link ImmutableUserActionsClientConfig ImmutableUserActionsClientConfig}.
*
* ImmutableUserActionsClientConfig.builder()
* .webClient(io.vertx.mutiny.ext.web.client.WebClient) // required {@link UserActionsClient.UserActionsClientConfig#getWebClient() webClient}
* .defaultLanguage(String) // required {@link UserActionsClient.UserActionsClientConfig#getDefaultLanguage() defaultLanguage}
* .servicePath(String) // required {@link UserActionsClient.UserActionsClientConfig#getServicePath() servicePath}
* .fillPath(String) // required {@link UserActionsClient.UserActionsClientConfig#getFillPath() fillPath}
* .reviewPath(String) // required {@link UserActionsClient.UserActionsClientConfig#getReviewPath() reviewPath}
* .messagesPath(String) // required {@link UserActionsClient.UserActionsClientConfig#getMessagesPath() messagesPath}
* .attachmentsPath(String) // required {@link UserActionsClient.UserActionsClientConfig#getAttachmentsPath() attachmentsPath}
* .authorizationsPath(String) // required {@link UserActionsClient.UserActionsClientConfig#getAuthorizationsPath() authorizationsPath}
* .attachments(io.thestencil.iam.api.RemoteIntegration | null) // nullable {@link UserActionsClient.UserActionsClientConfig#getAttachments() attachments}
* .fill(io.thestencil.iam.api.RemoteIntegration | null) // nullable {@link UserActionsClient.UserActionsClientConfig#getFill() fill}
* .review(io.thestencil.iam.api.RemoteIntegration | null) // nullable {@link UserActionsClient.UserActionsClientConfig#getReview() review}
* .replyTo(io.thestencil.iam.api.RemoteIntegration | null) // nullable {@link UserActionsClient.UserActionsClientConfig#getReplyTo() replyTo}
* .processes(io.thestencil.iam.api.RemoteIntegration) // required {@link UserActionsClient.UserActionsClientConfig#getProcesses() processes}
* .build();
*
* @return A new ImmutableUserActionsClientConfig builder
*/
public static ImmutableUserActionsClientConfig.Builder builder() {
return new ImmutableUserActionsClientConfig.Builder();
}
/**
* Builds instances of type {@link ImmutableUserActionsClientConfig ImmutableUserActionsClientConfig}.
* Initialize attributes and then invoke the {@link #build()} method to create an
* immutable instance.
* {@code Builder} is not thread-safe and generally should not be stored in a field or collection,
* but instead used immediately to create instances.
*/
@Generated(from = "UserActionsClient.UserActionsClientConfig", generator = "Immutables")
@NotThreadSafe
public static final class Builder {
private static final long INIT_BIT_WEB_CLIENT = 0x1L;
private static final long INIT_BIT_DEFAULT_LANGUAGE = 0x2L;
private static final long INIT_BIT_SERVICE_PATH = 0x4L;
private static final long INIT_BIT_FILL_PATH = 0x8L;
private static final long INIT_BIT_REVIEW_PATH = 0x10L;
private static final long INIT_BIT_MESSAGES_PATH = 0x20L;
private static final long INIT_BIT_ATTACHMENTS_PATH = 0x40L;
private static final long INIT_BIT_AUTHORIZATIONS_PATH = 0x80L;
private static final long INIT_BIT_PROCESSES = 0x100L;
private long initBits = 0x1ffL;
private @Nullable WebClient webClient;
private @Nullable String defaultLanguage;
private @Nullable String servicePath;
private @Nullable String fillPath;
private @Nullable String reviewPath;
private @Nullable String messagesPath;
private @Nullable String attachmentsPath;
private @Nullable String authorizationsPath;
private @Nullable RemoteIntegration attachments;
private @Nullable RemoteIntegration fill;
private @Nullable RemoteIntegration review;
private @Nullable RemoteIntegration replyTo;
private @Nullable RemoteIntegration processes;
private Builder() {
}
/**
* Fill a builder with attribute values from the provided {@code UserActionsClientConfig} instance.
* Regular attribute values will be replaced with those from the given instance.
* Absent optional values will not replace present values.
* @param instance The instance from which to copy values
* @return {@code this} builder for use in a chained invocation
*/
@CanIgnoreReturnValue
public final Builder from(UserActionsClient.UserActionsClientConfig instance) {
Objects.requireNonNull(instance, "instance");
webClient(instance.getWebClient());
defaultLanguage(instance.getDefaultLanguage());
servicePath(instance.getServicePath());
fillPath(instance.getFillPath());
reviewPath(instance.getReviewPath());
messagesPath(instance.getMessagesPath());
attachmentsPath(instance.getAttachmentsPath());
authorizationsPath(instance.getAuthorizationsPath());
@Nullable RemoteIntegration attachmentsValue = instance.getAttachments();
if (attachmentsValue != null) {
attachments(attachmentsValue);
}
@Nullable RemoteIntegration fillValue = instance.getFill();
if (fillValue != null) {
fill(fillValue);
}
@Nullable RemoteIntegration reviewValue = instance.getReview();
if (reviewValue != null) {
review(reviewValue);
}
@Nullable RemoteIntegration replyToValue = instance.getReplyTo();
if (replyToValue != null) {
replyTo(replyToValue);
}
processes(instance.getProcesses());
return this;
}
/**
* Initializes the value for the {@link UserActionsClient.UserActionsClientConfig#getWebClient() webClient} attribute.
* @param webClient The value for webClient
* @return {@code this} builder for use in a chained invocation
*/
@CanIgnoreReturnValue
public final Builder webClient(WebClient webClient) {
this.webClient = Objects.requireNonNull(webClient, "webClient");
initBits &= ~INIT_BIT_WEB_CLIENT;
return this;
}
/**
* Initializes the value for the {@link UserActionsClient.UserActionsClientConfig#getDefaultLanguage() defaultLanguage} attribute.
* @param defaultLanguage The value for defaultLanguage
* @return {@code this} builder for use in a chained invocation
*/
@CanIgnoreReturnValue
public final Builder defaultLanguage(String defaultLanguage) {
this.defaultLanguage = Objects.requireNonNull(defaultLanguage, "defaultLanguage");
initBits &= ~INIT_BIT_DEFAULT_LANGUAGE;
return this;
}
/**
* Initializes the value for the {@link UserActionsClient.UserActionsClientConfig#getServicePath() servicePath} attribute.
* @param servicePath The value for servicePath
* @return {@code this} builder for use in a chained invocation
*/
@CanIgnoreReturnValue
public final Builder servicePath(String servicePath) {
this.servicePath = Objects.requireNonNull(servicePath, "servicePath");
initBits &= ~INIT_BIT_SERVICE_PATH;
return this;
}
/**
* Initializes the value for the {@link UserActionsClient.UserActionsClientConfig#getFillPath() fillPath} attribute.
* @param fillPath The value for fillPath
* @return {@code this} builder for use in a chained invocation
*/
@CanIgnoreReturnValue
public final Builder fillPath(String fillPath) {
this.fillPath = Objects.requireNonNull(fillPath, "fillPath");
initBits &= ~INIT_BIT_FILL_PATH;
return this;
}
/**
* Initializes the value for the {@link UserActionsClient.UserActionsClientConfig#getReviewPath() reviewPath} attribute.
* @param reviewPath The value for reviewPath
* @return {@code this} builder for use in a chained invocation
*/
@CanIgnoreReturnValue
public final Builder reviewPath(String reviewPath) {
this.reviewPath = Objects.requireNonNull(reviewPath, "reviewPath");
initBits &= ~INIT_BIT_REVIEW_PATH;
return this;
}
/**
* Initializes the value for the {@link UserActionsClient.UserActionsClientConfig#getMessagesPath() messagesPath} attribute.
* @param messagesPath The value for messagesPath
* @return {@code this} builder for use in a chained invocation
*/
@CanIgnoreReturnValue
public final Builder messagesPath(String messagesPath) {
this.messagesPath = Objects.requireNonNull(messagesPath, "messagesPath");
initBits &= ~INIT_BIT_MESSAGES_PATH;
return this;
}
/**
* Initializes the value for the {@link UserActionsClient.UserActionsClientConfig#getAttachmentsPath() attachmentsPath} attribute.
* @param attachmentsPath The value for attachmentsPath
* @return {@code this} builder for use in a chained invocation
*/
@CanIgnoreReturnValue
public final Builder attachmentsPath(String attachmentsPath) {
this.attachmentsPath = Objects.requireNonNull(attachmentsPath, "attachmentsPath");
initBits &= ~INIT_BIT_ATTACHMENTS_PATH;
return this;
}
/**
* Initializes the value for the {@link UserActionsClient.UserActionsClientConfig#getAuthorizationsPath() authorizationsPath} attribute.
* @param authorizationsPath The value for authorizationsPath
* @return {@code this} builder for use in a chained invocation
*/
@CanIgnoreReturnValue
public final Builder authorizationsPath(String authorizationsPath) {
this.authorizationsPath = Objects.requireNonNull(authorizationsPath, "authorizationsPath");
initBits &= ~INIT_BIT_AUTHORIZATIONS_PATH;
return this;
}
/**
* Initializes the value for the {@link UserActionsClient.UserActionsClientConfig#getAttachments() attachments} attribute.
* @param attachments The value for attachments (can be {@code null})
* @return {@code this} builder for use in a chained invocation
*/
@CanIgnoreReturnValue
public final Builder attachments(@Nullable RemoteIntegration attachments) {
this.attachments = attachments;
return this;
}
/**
* Initializes the value for the {@link UserActionsClient.UserActionsClientConfig#getFill() fill} attribute.
* @param fill The value for fill (can be {@code null})
* @return {@code this} builder for use in a chained invocation
*/
@CanIgnoreReturnValue
public final Builder fill(@Nullable RemoteIntegration fill) {
this.fill = fill;
return this;
}
/**
* Initializes the value for the {@link UserActionsClient.UserActionsClientConfig#getReview() review} attribute.
* @param review The value for review (can be {@code null})
* @return {@code this} builder for use in a chained invocation
*/
@CanIgnoreReturnValue
public final Builder review(@Nullable RemoteIntegration review) {
this.review = review;
return this;
}
/**
* Initializes the value for the {@link UserActionsClient.UserActionsClientConfig#getReplyTo() replyTo} attribute.
* @param replyTo The value for replyTo (can be {@code null})
* @return {@code this} builder for use in a chained invocation
*/
@CanIgnoreReturnValue
public final Builder replyTo(@Nullable RemoteIntegration replyTo) {
this.replyTo = replyTo;
return this;
}
/**
* Initializes the value for the {@link UserActionsClient.UserActionsClientConfig#getProcesses() processes} attribute.
* @param processes The value for processes
* @return {@code this} builder for use in a chained invocation
*/
@CanIgnoreReturnValue
public final Builder processes(RemoteIntegration processes) {
this.processes = Objects.requireNonNull(processes, "processes");
initBits &= ~INIT_BIT_PROCESSES;
return this;
}
/**
* Builds a new {@link ImmutableUserActionsClientConfig ImmutableUserActionsClientConfig}.
* @return An immutable instance of UserActionsClientConfig
* @throws java.lang.IllegalStateException if any required attributes are missing
*/
public ImmutableUserActionsClientConfig build() {
if (initBits != 0) {
throw new IllegalStateException(formatRequiredAttributesMessage());
}
return new ImmutableUserActionsClientConfig(
webClient,
defaultLanguage,
servicePath,
fillPath,
reviewPath,
messagesPath,
attachmentsPath,
authorizationsPath,
attachments,
fill,
review,
replyTo,
processes);
}
private String formatRequiredAttributesMessage() {
List attributes = new ArrayList<>();
if ((initBits & INIT_BIT_WEB_CLIENT) != 0) attributes.add("webClient");
if ((initBits & INIT_BIT_DEFAULT_LANGUAGE) != 0) attributes.add("defaultLanguage");
if ((initBits & INIT_BIT_SERVICE_PATH) != 0) attributes.add("servicePath");
if ((initBits & INIT_BIT_FILL_PATH) != 0) attributes.add("fillPath");
if ((initBits & INIT_BIT_REVIEW_PATH) != 0) attributes.add("reviewPath");
if ((initBits & INIT_BIT_MESSAGES_PATH) != 0) attributes.add("messagesPath");
if ((initBits & INIT_BIT_ATTACHMENTS_PATH) != 0) attributes.add("attachmentsPath");
if ((initBits & INIT_BIT_AUTHORIZATIONS_PATH) != 0) attributes.add("authorizationsPath");
if ((initBits & INIT_BIT_PROCESSES) != 0) attributes.add("processes");
return "Cannot build UserActionsClientConfig, some of required attributes are not set " + attributes;
}
}
}