
com.hubspot.slack.client.models.interaction.MessageAction Maven / Gradle / Ivy
package com.hubspot.slack.client.models.interaction;
import com.fasterxml.jackson.annotation.JsonAutoDetect;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import com.hubspot.immutables.validation.InvalidImmutableStateException;
import com.hubspot.slack.client.models.LiteMessage;
import com.hubspot.slack.client.models.SlackChannel;
import com.hubspot.slack.client.models.teams.SlackTeam;
import com.hubspot.slack.client.models.users.SlackUserLite;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
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 MessageActionIF}.
*
* Use the builder to create immutable instances:
* {@code MessageAction.builder()}.
*/
@Generated(from = "MessageActionIF", generator = "Immutables")
@SuppressWarnings({"all"})
@SuppressFBWarnings
@ParametersAreNonnullByDefault
@javax.annotation.processing.Generated("org.immutables.processor.ProxyProcessor")
@Immutable
public final class MessageAction implements MessageActionIF {
private final InteractiveCallbackType type;
private final String token;
private final SlackTeam team;
private final SlackUserLite user;
private final SlackChannel channel;
private final String actionTs;
private final String callbackId;
private final String triggerId;
private final String responseUrl;
private final LiteMessage message;
private MessageAction(
InteractiveCallbackType type,
String token,
SlackTeam team,
SlackUserLite user,
SlackChannel channel,
String actionTs,
String callbackId,
String triggerId,
String responseUrl,
LiteMessage message) {
this.type = type;
this.token = token;
this.team = team;
this.user = user;
this.channel = channel;
this.actionTs = actionTs;
this.callbackId = callbackId;
this.triggerId = triggerId;
this.responseUrl = responseUrl;
this.message = message;
}
/**
* @return The value of the {@code type} attribute
*/
@JsonProperty
@Override
public InteractiveCallbackType getType() {
return type;
}
/**
* @return The value of the {@code token} attribute
*/
@JsonProperty
@Override
public String getToken() {
return token;
}
/**
* @return The value of the {@code team} attribute
*/
@JsonProperty
@Override
public SlackTeam getTeam() {
return team;
}
/**
* @return The value of the {@code user} attribute
*/
@JsonProperty
@Override
public SlackUserLite getUser() {
return user;
}
/**
* @return The value of the {@code channel} attribute
*/
@JsonProperty
@Override
public SlackChannel getChannel() {
return channel;
}
/**
* @return The value of the {@code actionTs} attribute
*/
@JsonProperty
@Override
public String getActionTs() {
return actionTs;
}
/**
* @return The value of the {@code callbackId} attribute
*/
@JsonProperty
@Override
public String getCallbackId() {
return callbackId;
}
/**
* @return The value of the {@code triggerId} attribute
*/
@JsonProperty
@Override
public String getTriggerId() {
return triggerId;
}
/**
* @return The value of the {@code responseUrl} attribute
*/
@JsonProperty
@Override
public String getResponseUrl() {
return responseUrl;
}
/**
* @return The value of the {@code message} attribute
*/
@JsonProperty
@Override
public LiteMessage getMessage() {
return message;
}
/**
* Copy the current immutable object by setting a value for the {@link MessageActionIF#getType() type} attribute.
* A value equality check is used to prevent copying of the same value by returning {@code this}.
* @param value A new value for type
* @return A modified copy of the {@code this} object
*/
public final MessageAction withType(InteractiveCallbackType value) {
InteractiveCallbackType newValue = Objects.requireNonNull(value, "type");
if (this.type == newValue) return this;
return new MessageAction(
newValue,
this.token,
this.team,
this.user,
this.channel,
this.actionTs,
this.callbackId,
this.triggerId,
this.responseUrl,
this.message);
}
/**
* Copy the current immutable object by setting a value for the {@link MessageActionIF#getToken() token} attribute.
* An equals check used to prevent copying of the same value by returning {@code this}.
* @param value A new value for token
* @return A modified copy of the {@code this} object
*/
public final MessageAction withToken(String value) {
String newValue = Objects.requireNonNull(value, "token");
if (this.token.equals(newValue)) return this;
return new MessageAction(
this.type,
newValue,
this.team,
this.user,
this.channel,
this.actionTs,
this.callbackId,
this.triggerId,
this.responseUrl,
this.message);
}
/**
* Copy the current immutable object by setting a value for the {@link MessageActionIF#getTeam() team} 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 team
* @return A modified copy of the {@code this} object
*/
public final MessageAction withTeam(SlackTeam value) {
if (this.team == value) return this;
SlackTeam newValue = Objects.requireNonNull(value, "team");
return new MessageAction(
this.type,
this.token,
newValue,
this.user,
this.channel,
this.actionTs,
this.callbackId,
this.triggerId,
this.responseUrl,
this.message);
}
/**
* Copy the current immutable object by setting a value for the {@link MessageActionIF#getUser() user} 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 user
* @return A modified copy of the {@code this} object
*/
public final MessageAction withUser(SlackUserLite value) {
if (this.user == value) return this;
SlackUserLite newValue = Objects.requireNonNull(value, "user");
return new MessageAction(
this.type,
this.token,
this.team,
newValue,
this.channel,
this.actionTs,
this.callbackId,
this.triggerId,
this.responseUrl,
this.message);
}
/**
* Copy the current immutable object by setting a value for the {@link MessageActionIF#getChannel() channel} 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 channel
* @return A modified copy of the {@code this} object
*/
public final MessageAction withChannel(SlackChannel value) {
if (this.channel == value) return this;
SlackChannel newValue = Objects.requireNonNull(value, "channel");
return new MessageAction(
this.type,
this.token,
this.team,
this.user,
newValue,
this.actionTs,
this.callbackId,
this.triggerId,
this.responseUrl,
this.message);
}
/**
* Copy the current immutable object by setting a value for the {@link MessageActionIF#getActionTs() actionTs} attribute.
* An equals check used to prevent copying of the same value by returning {@code this}.
* @param value A new value for actionTs
* @return A modified copy of the {@code this} object
*/
public final MessageAction withActionTs(String value) {
String newValue = Objects.requireNonNull(value, "actionTs");
if (this.actionTs.equals(newValue)) return this;
return new MessageAction(
this.type,
this.token,
this.team,
this.user,
this.channel,
newValue,
this.callbackId,
this.triggerId,
this.responseUrl,
this.message);
}
/**
* Copy the current immutable object by setting a value for the {@link MessageActionIF#getCallbackId() callbackId} attribute.
* An equals check used to prevent copying of the same value by returning {@code this}.
* @param value A new value for callbackId
* @return A modified copy of the {@code this} object
*/
public final MessageAction withCallbackId(String value) {
String newValue = Objects.requireNonNull(value, "callbackId");
if (this.callbackId.equals(newValue)) return this;
return new MessageAction(
this.type,
this.token,
this.team,
this.user,
this.channel,
this.actionTs,
newValue,
this.triggerId,
this.responseUrl,
this.message);
}
/**
* Copy the current immutable object by setting a value for the {@link MessageActionIF#getTriggerId() triggerId} attribute.
* An equals check used to prevent copying of the same value by returning {@code this}.
* @param value A new value for triggerId
* @return A modified copy of the {@code this} object
*/
public final MessageAction withTriggerId(String value) {
String newValue = Objects.requireNonNull(value, "triggerId");
if (this.triggerId.equals(newValue)) return this;
return new MessageAction(
this.type,
this.token,
this.team,
this.user,
this.channel,
this.actionTs,
this.callbackId,
newValue,
this.responseUrl,
this.message);
}
/**
* Copy the current immutable object by setting a value for the {@link MessageActionIF#getResponseUrl() responseUrl} attribute.
* An equals check used to prevent copying of the same value by returning {@code this}.
* @param value A new value for responseUrl
* @return A modified copy of the {@code this} object
*/
public final MessageAction withResponseUrl(String value) {
String newValue = Objects.requireNonNull(value, "responseUrl");
if (this.responseUrl.equals(newValue)) return this;
return new MessageAction(
this.type,
this.token,
this.team,
this.user,
this.channel,
this.actionTs,
this.callbackId,
this.triggerId,
newValue,
this.message);
}
/**
* Copy the current immutable object by setting a value for the {@link MessageActionIF#getMessage() message} 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 message
* @return A modified copy of the {@code this} object
*/
public final MessageAction withMessage(LiteMessage value) {
if (this.message == value) return this;
LiteMessage newValue = Objects.requireNonNull(value, "message");
return new MessageAction(
this.type,
this.token,
this.team,
this.user,
this.channel,
this.actionTs,
this.callbackId,
this.triggerId,
this.responseUrl,
newValue);
}
/**
* This instance is equal to all instances of {@code MessageAction} 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 MessageAction
&& equalTo(0, (MessageAction) another);
}
private boolean equalTo(int synthetic, MessageAction another) {
return type.equals(another.type)
&& token.equals(another.token)
&& team.equals(another.team)
&& user.equals(another.user)
&& channel.equals(another.channel)
&& actionTs.equals(another.actionTs)
&& callbackId.equals(another.callbackId)
&& triggerId.equals(another.triggerId)
&& responseUrl.equals(another.responseUrl)
&& message.equals(another.message);
}
/**
* Computes a hash code from attributes: {@code type}, {@code token}, {@code team}, {@code user}, {@code channel}, {@code actionTs}, {@code callbackId}, {@code triggerId}, {@code responseUrl}, {@code message}.
* @return hashCode value
*/
@Override
public int hashCode() {
int h = 5381;
h += (h << 5) + type.hashCode();
h += (h << 5) + token.hashCode();
h += (h << 5) + team.hashCode();
h += (h << 5) + user.hashCode();
h += (h << 5) + channel.hashCode();
h += (h << 5) + actionTs.hashCode();
h += (h << 5) + callbackId.hashCode();
h += (h << 5) + triggerId.hashCode();
h += (h << 5) + responseUrl.hashCode();
h += (h << 5) + message.hashCode();
return h;
}
/**
* Prints the immutable value {@code MessageAction} with attribute values.
* @return A string representation of the value
*/
@Override
public String toString() {
return "MessageAction{"
+ "type=" + type
+ ", token=" + token
+ ", team=" + team
+ ", user=" + user
+ ", channel=" + channel
+ ", actionTs=" + actionTs
+ ", callbackId=" + callbackId
+ ", triggerId=" + triggerId
+ ", responseUrl=" + responseUrl
+ ", message=" + message
+ "}";
}
/**
* Utility type used to correctly read immutable object from JSON representation.
* @deprecated Do not use this type directly, it exists only for the Jackson-binding infrastructure
*/
@Generated(from = "MessageActionIF", generator = "Immutables")
@Deprecated
@JsonTypeInfo(use=JsonTypeInfo.Id.NONE)
@JsonAutoDetect(fieldVisibility = JsonAutoDetect.Visibility.NONE)
static final class Json implements MessageActionIF {
@Nullable InteractiveCallbackType type;
@Nullable String token;
@Nullable SlackTeam team;
@Nullable SlackUserLite user;
@Nullable SlackChannel channel;
@Nullable String actionTs;
@Nullable String callbackId;
@Nullable String triggerId;
@Nullable String responseUrl;
@Nullable LiteMessage message;
@JsonProperty
public void setType(InteractiveCallbackType type) {
this.type = type;
}
@JsonProperty
public void setToken(String token) {
this.token = token;
}
@JsonProperty
public void setTeam(SlackTeam team) {
this.team = team;
}
@JsonProperty
public void setUser(SlackUserLite user) {
this.user = user;
}
@JsonProperty
public void setChannel(SlackChannel channel) {
this.channel = channel;
}
@JsonProperty
public void setActionTs(String actionTs) {
this.actionTs = actionTs;
}
@JsonProperty
public void setCallbackId(String callbackId) {
this.callbackId = callbackId;
}
@JsonProperty
public void setTriggerId(String triggerId) {
this.triggerId = triggerId;
}
@JsonProperty
public void setResponseUrl(String responseUrl) {
this.responseUrl = responseUrl;
}
@JsonProperty
public void setMessage(LiteMessage message) {
this.message = message;
}
@Override
public InteractiveCallbackType getType() { throw new UnsupportedOperationException(); }
@Override
public String getToken() { throw new UnsupportedOperationException(); }
@Override
public SlackTeam getTeam() { throw new UnsupportedOperationException(); }
@Override
public SlackUserLite getUser() { throw new UnsupportedOperationException(); }
@Override
public SlackChannel getChannel() { throw new UnsupportedOperationException(); }
@Override
public String getActionTs() { throw new UnsupportedOperationException(); }
@Override
public String getCallbackId() { throw new UnsupportedOperationException(); }
@Override
public String getTriggerId() { throw new UnsupportedOperationException(); }
@Override
public String getResponseUrl() { throw new UnsupportedOperationException(); }
@Override
public LiteMessage getMessage() { throw new UnsupportedOperationException(); }
}
/**
* @param json A JSON-bindable data structure
* @return An immutable value type
* @deprecated Do not use this method directly, it exists only for the Jackson-binding infrastructure
*/
@Deprecated
@JsonCreator(mode = JsonCreator.Mode.DELEGATING)
static MessageAction fromJson(Json json) {
MessageAction.Builder builder = MessageAction.builder();
if (json.type != null) {
builder.setType(json.type);
}
if (json.token != null) {
builder.setToken(json.token);
}
if (json.team != null) {
builder.setTeam(json.team);
}
if (json.user != null) {
builder.setUser(json.user);
}
if (json.channel != null) {
builder.setChannel(json.channel);
}
if (json.actionTs != null) {
builder.setActionTs(json.actionTs);
}
if (json.callbackId != null) {
builder.setCallbackId(json.callbackId);
}
if (json.triggerId != null) {
builder.setTriggerId(json.triggerId);
}
if (json.responseUrl != null) {
builder.setResponseUrl(json.responseUrl);
}
if (json.message != null) {
builder.setMessage(json.message);
}
return builder.build();
}
/**
* Creates an immutable copy of a {@link MessageActionIF} 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 MessageAction instance
*/
public static MessageAction copyOf(MessageActionIF instance) {
if (instance instanceof MessageAction) {
return (MessageAction) instance;
}
return MessageAction.builder()
.from(instance)
.build();
}
/**
* Creates a builder for {@link MessageAction MessageAction}.
*
* MessageAction.builder()
* .setType(com.hubspot.slack.client.models.interaction.InteractiveCallbackType) // required {@link MessageActionIF#getType() type}
* .setToken(String) // required {@link MessageActionIF#getToken() token}
* .setTeam(com.hubspot.slack.client.models.teams.SlackTeam) // required {@link MessageActionIF#getTeam() team}
* .setUser(com.hubspot.slack.client.models.users.SlackUserLite) // required {@link MessageActionIF#getUser() user}
* .setChannel(com.hubspot.slack.client.models.SlackChannel) // required {@link MessageActionIF#getChannel() channel}
* .setActionTs(String) // required {@link MessageActionIF#getActionTs() actionTs}
* .setCallbackId(String) // required {@link MessageActionIF#getCallbackId() callbackId}
* .setTriggerId(String) // required {@link MessageActionIF#getTriggerId() triggerId}
* .setResponseUrl(String) // required {@link MessageActionIF#getResponseUrl() responseUrl}
* .setMessage(com.hubspot.slack.client.models.LiteMessage) // required {@link MessageActionIF#getMessage() message}
* .build();
*
* @return A new MessageAction builder
*/
public static MessageAction.Builder builder() {
return new MessageAction.Builder();
}
/**
* Builds instances of type {@link MessageAction MessageAction}.
* 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 = "MessageActionIF", generator = "Immutables")
@NotThreadSafe
public static final class Builder {
private static final long INIT_BIT_TYPE = 0x1L;
private static final long INIT_BIT_TOKEN = 0x2L;
private static final long INIT_BIT_TEAM = 0x4L;
private static final long INIT_BIT_USER = 0x8L;
private static final long INIT_BIT_CHANNEL = 0x10L;
private static final long INIT_BIT_ACTION_TS = 0x20L;
private static final long INIT_BIT_CALLBACK_ID = 0x40L;
private static final long INIT_BIT_TRIGGER_ID = 0x80L;
private static final long INIT_BIT_RESPONSE_URL = 0x100L;
private static final long INIT_BIT_MESSAGE = 0x200L;
private long initBits = 0x3ffL;
private @Nullable InteractiveCallbackType type;
private @Nullable String token;
private @Nullable SlackTeam team;
private @Nullable SlackUserLite user;
private @Nullable SlackChannel channel;
private @Nullable String actionTs;
private @Nullable String callbackId;
private @Nullable String triggerId;
private @Nullable String responseUrl;
private @Nullable LiteMessage message;
private Builder() {
}
/**
* Fill a builder with attribute values from the provided {@code com.hubspot.slack.client.models.interaction.SlackInteractiveCallback} instance.
* @param instance The instance from which to copy values
* @return {@code this} builder for use in a chained invocation
*/
public final Builder from(SlackInteractiveCallback instance) {
Objects.requireNonNull(instance, "instance");
from((short) 0, (Object) instance);
return this;
}
/**
* Fill a builder with attribute values from the provided {@code com.hubspot.slack.client.models.interaction.MessageActionIF} instance.
* @param instance The instance from which to copy values
* @return {@code this} builder for use in a chained invocation
*/
public final Builder from(MessageActionIF instance) {
Objects.requireNonNull(instance, "instance");
from((short) 0, (Object) instance);
return this;
}
private void from(short _unused, Object object) {
long bits = 0;
if (object instanceof SlackInteractiveCallback) {
SlackInteractiveCallback instance = (SlackInteractiveCallback) object;
if ((bits & 0x10L) == 0) {
this.setCallbackId(instance.getCallbackId());
bits |= 0x10L;
}
if ((bits & 0x1L) == 0) {
this.setChannel(instance.getChannel());
bits |= 0x1L;
}
if ((bits & 0x2L) == 0) {
this.setTeam(instance.getTeam());
bits |= 0x2L;
}
if ((bits & 0x4L) == 0) {
this.setType(instance.getType());
bits |= 0x4L;
}
if ((bits & 0x20L) == 0) {
this.setUser(instance.getUser());
bits |= 0x20L;
}
if ((bits & 0x40L) == 0) {
this.setActionTs(instance.getActionTs());
bits |= 0x40L;
}
if ((bits & 0x8L) == 0) {
this.setToken(instance.getToken());
bits |= 0x8L;
}
}
if (object instanceof MessageActionIF) {
MessageActionIF instance = (MessageActionIF) object;
this.setResponseUrl(instance.getResponseUrl());
if ((bits & 0x10L) == 0) {
this.setCallbackId(instance.getCallbackId());
bits |= 0x10L;
}
this.setTriggerId(instance.getTriggerId());
if ((bits & 0x1L) == 0) {
this.setChannel(instance.getChannel());
bits |= 0x1L;
}
if ((bits & 0x2L) == 0) {
this.setTeam(instance.getTeam());
bits |= 0x2L;
}
if ((bits & 0x4L) == 0) {
this.setType(instance.getType());
bits |= 0x4L;
}
this.setMessage(instance.getMessage());
if ((bits & 0x20L) == 0) {
this.setUser(instance.getUser());
bits |= 0x20L;
}
if ((bits & 0x40L) == 0) {
this.setActionTs(instance.getActionTs());
bits |= 0x40L;
}
if ((bits & 0x8L) == 0) {
this.setToken(instance.getToken());
bits |= 0x8L;
}
}
}
/**
* Initializes the value for the {@link MessageActionIF#getType() type} attribute.
* @param type The value for type
* @return {@code this} builder for use in a chained invocation
*/
public final Builder setType(InteractiveCallbackType type) {
this.type = Objects.requireNonNull(type, "type");
initBits &= ~INIT_BIT_TYPE;
return this;
}
/**
* Initializes the value for the {@link MessageActionIF#getToken() token} attribute.
* @param token The value for token
* @return {@code this} builder for use in a chained invocation
*/
public final Builder setToken(String token) {
this.token = Objects.requireNonNull(token, "token");
initBits &= ~INIT_BIT_TOKEN;
return this;
}
/**
* Initializes the value for the {@link MessageActionIF#getTeam() team} attribute.
* @param team The value for team
* @return {@code this} builder for use in a chained invocation
*/
public final Builder setTeam(SlackTeam team) {
this.team = Objects.requireNonNull(team, "team");
initBits &= ~INIT_BIT_TEAM;
return this;
}
/**
* Initializes the value for the {@link MessageActionIF#getUser() user} attribute.
* @param user The value for user
* @return {@code this} builder for use in a chained invocation
*/
public final Builder setUser(SlackUserLite user) {
this.user = Objects.requireNonNull(user, "user");
initBits &= ~INIT_BIT_USER;
return this;
}
/**
* Initializes the value for the {@link MessageActionIF#getChannel() channel} attribute.
* @param channel The value for channel
* @return {@code this} builder for use in a chained invocation
*/
public final Builder setChannel(SlackChannel channel) {
this.channel = Objects.requireNonNull(channel, "channel");
initBits &= ~INIT_BIT_CHANNEL;
return this;
}
/**
* Initializes the value for the {@link MessageActionIF#getActionTs() actionTs} attribute.
* @param actionTs The value for actionTs
* @return {@code this} builder for use in a chained invocation
*/
public final Builder setActionTs(String actionTs) {
this.actionTs = Objects.requireNonNull(actionTs, "actionTs");
initBits &= ~INIT_BIT_ACTION_TS;
return this;
}
/**
* Initializes the value for the {@link MessageActionIF#getCallbackId() callbackId} attribute.
* @param callbackId The value for callbackId
* @return {@code this} builder for use in a chained invocation
*/
public final Builder setCallbackId(String callbackId) {
this.callbackId = Objects.requireNonNull(callbackId, "callbackId");
initBits &= ~INIT_BIT_CALLBACK_ID;
return this;
}
/**
* Initializes the value for the {@link MessageActionIF#getTriggerId() triggerId} attribute.
* @param triggerId The value for triggerId
* @return {@code this} builder for use in a chained invocation
*/
public final Builder setTriggerId(String triggerId) {
this.triggerId = Objects.requireNonNull(triggerId, "triggerId");
initBits &= ~INIT_BIT_TRIGGER_ID;
return this;
}
/**
* Initializes the value for the {@link MessageActionIF#getResponseUrl() responseUrl} attribute.
* @param responseUrl The value for responseUrl
* @return {@code this} builder for use in a chained invocation
*/
public final Builder setResponseUrl(String responseUrl) {
this.responseUrl = Objects.requireNonNull(responseUrl, "responseUrl");
initBits &= ~INIT_BIT_RESPONSE_URL;
return this;
}
/**
* Initializes the value for the {@link MessageActionIF#getMessage() message} attribute.
* @param message The value for message
* @return {@code this} builder for use in a chained invocation
*/
public final Builder setMessage(LiteMessage message) {
this.message = Objects.requireNonNull(message, "message");
initBits &= ~INIT_BIT_MESSAGE;
return this;
}
/**
* Builds a new {@link MessageAction MessageAction}.
* @return An immutable instance of MessageAction
* @throws com.hubspot.immutables.validation.InvalidImmutableStateException if any required attributes are missing
*/
public MessageAction build() {
checkRequiredAttributes();
return new MessageAction(type, token, team, user, channel, actionTs, callbackId, triggerId, responseUrl, message);
}
private boolean typeIsSet() {
return (initBits & INIT_BIT_TYPE) == 0;
}
private boolean tokenIsSet() {
return (initBits & INIT_BIT_TOKEN) == 0;
}
private boolean teamIsSet() {
return (initBits & INIT_BIT_TEAM) == 0;
}
private boolean userIsSet() {
return (initBits & INIT_BIT_USER) == 0;
}
private boolean channelIsSet() {
return (initBits & INIT_BIT_CHANNEL) == 0;
}
private boolean actionTsIsSet() {
return (initBits & INIT_BIT_ACTION_TS) == 0;
}
private boolean callbackIdIsSet() {
return (initBits & INIT_BIT_CALLBACK_ID) == 0;
}
private boolean triggerIdIsSet() {
return (initBits & INIT_BIT_TRIGGER_ID) == 0;
}
private boolean responseUrlIsSet() {
return (initBits & INIT_BIT_RESPONSE_URL) == 0;
}
private boolean messageIsSet() {
return (initBits & INIT_BIT_MESSAGE) == 0;
}
private void checkRequiredAttributes() {
if (initBits != 0) {
throw new InvalidImmutableStateException(formatRequiredAttributesMessage());
}
}
private String formatRequiredAttributesMessage() {
List attributes = new ArrayList<>();
if (!typeIsSet()) attributes.add("type");
if (!tokenIsSet()) attributes.add("token");
if (!teamIsSet()) attributes.add("team");
if (!userIsSet()) attributes.add("user");
if (!channelIsSet()) attributes.add("channel");
if (!actionTsIsSet()) attributes.add("actionTs");
if (!callbackIdIsSet()) attributes.add("callbackId");
if (!triggerIdIsSet()) attributes.add("triggerId");
if (!responseUrlIsSet()) attributes.add("responseUrl");
if (!messageIsSet()) attributes.add("message");
return "Cannot build MessageAction, some of required attributes are not set " + attributes;
}
}
}