All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.thestencil.iam.spi.integrations.ImmutableUserActionReplyInit Maven / Gradle / Ivy

The newest version!
package io.thestencil.iam.spi.integrations;

import com.google.common.base.MoreObjects;
import com.google.errorprone.annotations.CanIgnoreReturnValue;
import com.google.errorprone.annotations.Var;
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 ReplyToBuilderDefault.UserActionReplyInit}.
 * 

* Use the builder to create immutable instances: * {@code ImmutableUserActionReplyInit.builder()}. */ @Generated(from = "ReplyToBuilderDefault.UserActionReplyInit", generator = "Immutables") @SuppressWarnings({"all"}) @ParametersAreNonnullByDefault @javax.annotation.processing.Generated("org.immutables.processor.ProxyProcessor") @Immutable @CheckReturnValue public final class ImmutableUserActionReplyInit implements ReplyToBuilderDefault.UserActionReplyInit { private final String commentText; private final Boolean external; private final String replyToId; private final String taskId; private final String userName; private ImmutableUserActionReplyInit( String commentText, Boolean external, String replyToId, String taskId, String userName) { this.commentText = commentText; this.external = external; this.replyToId = replyToId; this.taskId = taskId; this.userName = userName; } /** * @return The value of the {@code commentText} attribute */ @Override public String getCommentText() { return commentText; } /** * @return The value of the {@code external} attribute */ @Override public Boolean getExternal() { return external; } /** * @return The value of the {@code replyToId} attribute */ @Override public String getReplyToId() { return replyToId; } /** * @return The value of the {@code taskId} attribute */ @Override public String getTaskId() { return taskId; } /** * @return The value of the {@code userName} attribute */ @Override public String getUserName() { return userName; } /** * Copy the current immutable object by setting a value for the {@link ReplyToBuilderDefault.UserActionReplyInit#getCommentText() commentText} attribute. * An equals check used to prevent copying of the same value by returning {@code this}. * @param value A new value for commentText * @return A modified copy of the {@code this} object */ public final ImmutableUserActionReplyInit withCommentText(String value) { String newValue = Objects.requireNonNull(value, "commentText"); if (this.commentText.equals(newValue)) return this; return new ImmutableUserActionReplyInit(newValue, this.external, this.replyToId, this.taskId, this.userName); } /** * Copy the current immutable object by setting a value for the {@link ReplyToBuilderDefault.UserActionReplyInit#getExternal() external} attribute. * An equals check used to prevent copying of the same value by returning {@code this}. * @param value A new value for external * @return A modified copy of the {@code this} object */ public final ImmutableUserActionReplyInit withExternal(Boolean value) { Boolean newValue = Objects.requireNonNull(value, "external"); if (this.external.equals(newValue)) return this; return new ImmutableUserActionReplyInit(this.commentText, newValue, this.replyToId, this.taskId, this.userName); } /** * Copy the current immutable object by setting a value for the {@link ReplyToBuilderDefault.UserActionReplyInit#getReplyToId() replyToId} attribute. * An equals check used to prevent copying of the same value by returning {@code this}. * @param value A new value for replyToId * @return A modified copy of the {@code this} object */ public final ImmutableUserActionReplyInit withReplyToId(String value) { String newValue = Objects.requireNonNull(value, "replyToId"); if (this.replyToId.equals(newValue)) return this; return new ImmutableUserActionReplyInit(this.commentText, this.external, newValue, this.taskId, this.userName); } /** * Copy the current immutable object by setting a value for the {@link ReplyToBuilderDefault.UserActionReplyInit#getTaskId() taskId} attribute. * An equals check used to prevent copying of the same value by returning {@code this}. * @param value A new value for taskId * @return A modified copy of the {@code this} object */ public final ImmutableUserActionReplyInit withTaskId(String value) { String newValue = Objects.requireNonNull(value, "taskId"); if (this.taskId.equals(newValue)) return this; return new ImmutableUserActionReplyInit(this.commentText, this.external, this.replyToId, newValue, this.userName); } /** * Copy the current immutable object by setting a value for the {@link ReplyToBuilderDefault.UserActionReplyInit#getUserName() userName} attribute. * An equals check used to prevent copying of the same value by returning {@code this}. * @param value A new value for userName * @return A modified copy of the {@code this} object */ public final ImmutableUserActionReplyInit withUserName(String value) { String newValue = Objects.requireNonNull(value, "userName"); if (this.userName.equals(newValue)) return this; return new ImmutableUserActionReplyInit(this.commentText, this.external, this.replyToId, this.taskId, newValue); } /** * This instance is equal to all instances of {@code ImmutableUserActionReplyInit} 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 ImmutableUserActionReplyInit && equalTo((ImmutableUserActionReplyInit) another); } private boolean equalTo(ImmutableUserActionReplyInit another) { return commentText.equals(another.commentText) && external.equals(another.external) && replyToId.equals(another.replyToId) && taskId.equals(another.taskId) && userName.equals(another.userName); } /** * Computes a hash code from attributes: {@code commentText}, {@code external}, {@code replyToId}, {@code taskId}, {@code userName}. * @return hashCode value */ @Override public int hashCode() { @Var int h = 5381; h += (h << 5) + commentText.hashCode(); h += (h << 5) + external.hashCode(); h += (h << 5) + replyToId.hashCode(); h += (h << 5) + taskId.hashCode(); h += (h << 5) + userName.hashCode(); return h; } /** * Prints the immutable value {@code UserActionReplyInit} with attribute values. * @return A string representation of the value */ @Override public String toString() { return MoreObjects.toStringHelper("UserActionReplyInit") .omitNullValues() .add("commentText", commentText) .add("external", external) .add("replyToId", replyToId) .add("taskId", taskId) .add("userName", userName) .toString(); } /** * Creates an immutable copy of a {@link ReplyToBuilderDefault.UserActionReplyInit} 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 UserActionReplyInit instance */ public static ImmutableUserActionReplyInit copyOf(ReplyToBuilderDefault.UserActionReplyInit instance) { if (instance instanceof ImmutableUserActionReplyInit) { return (ImmutableUserActionReplyInit) instance; } return ImmutableUserActionReplyInit.builder() .from(instance) .build(); } /** * Creates a builder for {@link ImmutableUserActionReplyInit ImmutableUserActionReplyInit}. *

   * ImmutableUserActionReplyInit.builder()
   *    .commentText(String) // required {@link ReplyToBuilderDefault.UserActionReplyInit#getCommentText() commentText}
   *    .external(Boolean) // required {@link ReplyToBuilderDefault.UserActionReplyInit#getExternal() external}
   *    .replyToId(String) // required {@link ReplyToBuilderDefault.UserActionReplyInit#getReplyToId() replyToId}
   *    .taskId(String) // required {@link ReplyToBuilderDefault.UserActionReplyInit#getTaskId() taskId}
   *    .userName(String) // required {@link ReplyToBuilderDefault.UserActionReplyInit#getUserName() userName}
   *    .build();
   * 
* @return A new ImmutableUserActionReplyInit builder */ public static ImmutableUserActionReplyInit.Builder builder() { return new ImmutableUserActionReplyInit.Builder(); } /** * Builds instances of type {@link ImmutableUserActionReplyInit ImmutableUserActionReplyInit}. * 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 = "ReplyToBuilderDefault.UserActionReplyInit", generator = "Immutables") @NotThreadSafe public static final class Builder { private static final long INIT_BIT_COMMENT_TEXT = 0x1L; private static final long INIT_BIT_EXTERNAL = 0x2L; private static final long INIT_BIT_REPLY_TO_ID = 0x4L; private static final long INIT_BIT_TASK_ID = 0x8L; private static final long INIT_BIT_USER_NAME = 0x10L; private long initBits = 0x1fL; private @Nullable String commentText; private @Nullable Boolean external; private @Nullable String replyToId; private @Nullable String taskId; private @Nullable String userName; private Builder() { } /** * Fill a builder with attribute values from the provided {@code UserActionReplyInit} 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(ReplyToBuilderDefault.UserActionReplyInit instance) { Objects.requireNonNull(instance, "instance"); commentText(instance.getCommentText()); external(instance.getExternal()); replyToId(instance.getReplyToId()); taskId(instance.getTaskId()); userName(instance.getUserName()); return this; } /** * Initializes the value for the {@link ReplyToBuilderDefault.UserActionReplyInit#getCommentText() commentText} attribute. * @param commentText The value for commentText * @return {@code this} builder for use in a chained invocation */ @CanIgnoreReturnValue public final Builder commentText(String commentText) { this.commentText = Objects.requireNonNull(commentText, "commentText"); initBits &= ~INIT_BIT_COMMENT_TEXT; return this; } /** * Initializes the value for the {@link ReplyToBuilderDefault.UserActionReplyInit#getExternal() external} attribute. * @param external The value for external * @return {@code this} builder for use in a chained invocation */ @CanIgnoreReturnValue public final Builder external(Boolean external) { this.external = Objects.requireNonNull(external, "external"); initBits &= ~INIT_BIT_EXTERNAL; return this; } /** * Initializes the value for the {@link ReplyToBuilderDefault.UserActionReplyInit#getReplyToId() replyToId} attribute. * @param replyToId The value for replyToId * @return {@code this} builder for use in a chained invocation */ @CanIgnoreReturnValue public final Builder replyToId(String replyToId) { this.replyToId = Objects.requireNonNull(replyToId, "replyToId"); initBits &= ~INIT_BIT_REPLY_TO_ID; return this; } /** * Initializes the value for the {@link ReplyToBuilderDefault.UserActionReplyInit#getTaskId() taskId} attribute. * @param taskId The value for taskId * @return {@code this} builder for use in a chained invocation */ @CanIgnoreReturnValue public final Builder taskId(String taskId) { this.taskId = Objects.requireNonNull(taskId, "taskId"); initBits &= ~INIT_BIT_TASK_ID; return this; } /** * Initializes the value for the {@link ReplyToBuilderDefault.UserActionReplyInit#getUserName() userName} attribute. * @param userName The value for userName * @return {@code this} builder for use in a chained invocation */ @CanIgnoreReturnValue public final Builder userName(String userName) { this.userName = Objects.requireNonNull(userName, "userName"); initBits &= ~INIT_BIT_USER_NAME; return this; } /** * Builds a new {@link ImmutableUserActionReplyInit ImmutableUserActionReplyInit}. * @return An immutable instance of UserActionReplyInit * @throws java.lang.IllegalStateException if any required attributes are missing */ public ImmutableUserActionReplyInit build() { if (initBits != 0) { throw new IllegalStateException(formatRequiredAttributesMessage()); } return new ImmutableUserActionReplyInit(commentText, external, replyToId, taskId, userName); } private String formatRequiredAttributesMessage() { List attributes = new ArrayList<>(); if ((initBits & INIT_BIT_COMMENT_TEXT) != 0) attributes.add("commentText"); if ((initBits & INIT_BIT_EXTERNAL) != 0) attributes.add("external"); if ((initBits & INIT_BIT_REPLY_TO_ID) != 0) attributes.add("replyToId"); if ((initBits & INIT_BIT_TASK_ID) != 0) attributes.add("taskId"); if ((initBits & INIT_BIT_USER_NAME) != 0) attributes.add("userName"); return "Cannot build UserActionReplyInit, some of required attributes are not set " + attributes; } } }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy