org.graylog2.rest.resources.system.indexer.responses.AutoValue_IndexSetSummary Maven / Gradle / Ivy
package org.graylog2.rest.resources.system.indexer.responses;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.time.ZonedDateTime;
import javax.annotation.Generated;
import javax.annotation.Nullable;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import org.graylog2.plugin.indexer.retention.RetentionStrategyConfig;
import org.graylog2.plugin.indexer.rotation.RotationStrategyConfig;
import org.hibernate.validator.constraints.NotBlank;
@Generated("com.google.auto.value.processor.AutoValueProcessor")
final class AutoValue_IndexSetSummary extends IndexSetSummary {
private final String id;
private final String title;
private final String description;
private final String indexPrefix;
private final int shards;
private final int replicas;
private final RotationStrategyConfig rotationStrategy;
private final RetentionStrategyConfig retentionStrategy;
private final ZonedDateTime creationDate;
AutoValue_IndexSetSummary(
@Nullable String id,
String title,
@Nullable String description,
String indexPrefix,
int shards,
int replicas,
RotationStrategyConfig rotationStrategy,
RetentionStrategyConfig retentionStrategy,
ZonedDateTime creationDate) {
this.id = id;
if (title == null) {
throw new NullPointerException("Null title");
}
this.title = title;
this.description = description;
if (indexPrefix == null) {
throw new NullPointerException("Null indexPrefix");
}
this.indexPrefix = indexPrefix;
this.shards = shards;
this.replicas = replicas;
if (rotationStrategy == null) {
throw new NullPointerException("Null rotationStrategy");
}
this.rotationStrategy = rotationStrategy;
if (retentionStrategy == null) {
throw new NullPointerException("Null retentionStrategy");
}
this.retentionStrategy = retentionStrategy;
if (creationDate == null) {
throw new NullPointerException("Null creationDate");
}
this.creationDate = creationDate;
}
@JsonProperty(value = "id")
@Nullable
@Override
public String id() {
return id;
}
@JsonProperty(value = "title")
@NotBlank
@Override
public String title() {
return title;
}
@JsonProperty(value = "description")
@Nullable
@Override
public String description() {
return description;
}
@JsonProperty(value = "index_prefix")
@NotBlank
@Override
public String indexPrefix() {
return indexPrefix;
}
@JsonProperty(value = "shards")
@Min(value = 1L)
@Override
public int shards() {
return shards;
}
@JsonProperty(value = "replicas")
@Min(value = 0L)
@Override
public int replicas() {
return replicas;
}
@JsonProperty(value = "rotation_strategy")
@NotNull
@Override
public RotationStrategyConfig rotationStrategy() {
return rotationStrategy;
}
@JsonProperty(value = "retention_strategy")
@NotNull
@Override
public RetentionStrategyConfig retentionStrategy() {
return retentionStrategy;
}
@JsonProperty(value = "creation_date")
@NotNull
@Override
public ZonedDateTime creationDate() {
return creationDate;
}
@Override
public String toString() {
return "IndexSetSummary{"
+ "id=" + id + ", "
+ "title=" + title + ", "
+ "description=" + description + ", "
+ "indexPrefix=" + indexPrefix + ", "
+ "shards=" + shards + ", "
+ "replicas=" + replicas + ", "
+ "rotationStrategy=" + rotationStrategy + ", "
+ "retentionStrategy=" + retentionStrategy + ", "
+ "creationDate=" + creationDate
+ "}";
}
@Override
public boolean equals(Object o) {
if (o == this) {
return true;
}
if (o instanceof IndexSetSummary) {
IndexSetSummary that = (IndexSetSummary) o;
return ((this.id == null) ? (that.id() == null) : this.id.equals(that.id()))
&& (this.title.equals(that.title()))
&& ((this.description == null) ? (that.description() == null) : this.description.equals(that.description()))
&& (this.indexPrefix.equals(that.indexPrefix()))
&& (this.shards == that.shards())
&& (this.replicas == that.replicas())
&& (this.rotationStrategy.equals(that.rotationStrategy()))
&& (this.retentionStrategy.equals(that.retentionStrategy()))
&& (this.creationDate.equals(that.creationDate()));
}
return false;
}
@Override
public int hashCode() {
int h = 1;
h *= 1000003;
h ^= (id == null) ? 0 : this.id.hashCode();
h *= 1000003;
h ^= this.title.hashCode();
h *= 1000003;
h ^= (description == null) ? 0 : this.description.hashCode();
h *= 1000003;
h ^= this.indexPrefix.hashCode();
h *= 1000003;
h ^= this.shards;
h *= 1000003;
h ^= this.replicas;
h *= 1000003;
h ^= this.rotationStrategy.hashCode();
h *= 1000003;
h ^= this.retentionStrategy.hashCode();
h *= 1000003;
h ^= this.creationDate.hashCode();
return h;
}
}