com.arakelian.elastic.model.ImmutableIndexDeleted Maven / Gradle / Ivy
package com.arakelian.elastic.model;
import com.arakelian.core.feature.Nullable;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.google.common.base.MoreObjects;
import com.google.errorprone.annotations.CanIgnoreReturnValue;
import com.google.errorprone.annotations.Var;
import java.util.Objects;
import javax.annotation.CheckReturnValue;
import javax.annotation.Generated;
import javax.annotation.ParametersAreNonnullByDefault;
import javax.annotation.concurrent.Immutable;
import javax.annotation.concurrent.NotThreadSafe;
/**
* Immutable implementation of {@link IndexDeleted}.
*
* Use the builder to create immutable instances:
* {@code ImmutableIndexDeleted.builder()}.
*/
@SuppressWarnings({"all"})
@ParametersAreNonnullByDefault
@Generated("org.immutables.processor.ProxyProcessor")
@Immutable
@CheckReturnValue
public final class ImmutableIndexDeleted implements IndexDeleted {
private final @Nullable Boolean acknowledged;
private ImmutableIndexDeleted(ImmutableIndexDeleted.Builder builder) {
this.acknowledged = builder.acknowledged;
}
/**
* @return The value of the {@code acknowledged} attribute
*/
@JsonProperty("acknowledged")
@Override
public @Nullable Boolean getAcknowledged() {
return acknowledged;
}
/**
* This instance is equal to all instances of {@code ImmutableIndexDeleted} that have equal attribute values.
* @return {@code true} if {@code this} is equal to {@code another} instance
*/
@Override
public boolean equals(@javax.annotation.Nullable Object another) {
if (this == another) return true;
return another instanceof ImmutableIndexDeleted
&& equalTo((ImmutableIndexDeleted) another);
}
private boolean equalTo(ImmutableIndexDeleted another) {
return Objects.equals(acknowledged, another.acknowledged);
}
/**
* Computes a hash code from attributes: {@code acknowledged}.
* @return hashCode value
*/
@Override
public int hashCode() {
@Var int h = 5381;
h += (h << 5) + Objects.hashCode(acknowledged);
return h;
}
/**
* Prints the immutable value {@code IndexDeleted} with attribute values.
* @return A string representation of the value
*/
@Override
public String toString() {
return MoreObjects.toStringHelper("IndexDeleted")
.omitNullValues()
.add("acknowledged", acknowledged)
.toString();
}
/**
* Creates a builder for {@link ImmutableIndexDeleted ImmutableIndexDeleted}.
* @return A new ImmutableIndexDeleted builder
*/
public static ImmutableIndexDeleted.Builder builder() {
return new ImmutableIndexDeleted.Builder();
}
/**
* Builds instances of type {@link ImmutableIndexDeleted ImmutableIndexDeleted}.
* 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.
*/
@NotThreadSafe
public static final class Builder {
private @javax.annotation.Nullable Boolean acknowledged;
private Builder() {
}
/**
* Fill a builder with attribute values from the provided {@code IndexDeleted} 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(IndexDeleted instance) {
Objects.requireNonNull(instance, "instance");
Boolean acknowledgedValue = instance.getAcknowledged();
if (acknowledgedValue != null) {
acknowledged(acknowledgedValue);
}
return this;
}
/**
* Initializes the value for the {@link IndexDeleted#getAcknowledged() acknowledged} attribute.
* @param acknowledged The value for acknowledged (can be {@code null})
* @return {@code this} builder for use in a chained invocation
*/
@CanIgnoreReturnValue
@JsonProperty("acknowledged")
public final Builder acknowledged(@Nullable Boolean acknowledged) {
this.acknowledged = acknowledged;
return this;
}
/**
* Builds a new {@link ImmutableIndexDeleted ImmutableIndexDeleted}.
* @return An immutable instance of IndexDeleted
* @throws java.lang.IllegalStateException if any required attributes are missing
*/
public ImmutableIndexDeleted build() {
return new ImmutableIndexDeleted(this);
}
}
}