org.graylog2.lookup.dto.AutoValue_DataAdapterDto Maven / Gradle / Ivy
package org.graylog2.lookup.dto;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.concurrent.TimeUnit;
import javax.annotation.Nullable;
import javax.annotation.processing.Generated;
import org.graylog2.plugin.lookup.LookupDataAdapterConfiguration;
import org.mongojack.Id;
import org.mongojack.ObjectId;
@Generated("com.google.auto.value.processor.AutoValueProcessor")
final class AutoValue_DataAdapterDto extends DataAdapterDto {
@Nullable
private final String id;
private final String scope;
private final String title;
private final String description;
private final String name;
@Nullable
private final Boolean customErrorTTLEnabled;
@Nullable
private final Long customErrorTTL;
@Nullable
private final TimeUnit customErrorTTLUnit;
@Nullable
private final String contentPack;
private final LookupDataAdapterConfiguration config;
private AutoValue_DataAdapterDto(
@Nullable String id,
String scope,
String title,
String description,
String name,
@Nullable Boolean customErrorTTLEnabled,
@Nullable Long customErrorTTL,
@Nullable TimeUnit customErrorTTLUnit,
@Nullable String contentPack,
LookupDataAdapterConfiguration config) {
this.id = id;
this.scope = scope;
this.title = title;
this.description = description;
this.name = name;
this.customErrorTTLEnabled = customErrorTTLEnabled;
this.customErrorTTL = customErrorTTL;
this.customErrorTTLUnit = customErrorTTLUnit;
this.contentPack = contentPack;
this.config = config;
}
@JsonProperty("id")
@Nullable
@Id
@ObjectId
@Override
public String id() {
return id;
}
@JsonProperty("_scope")
@Override
public String scope() {
return scope;
}
@JsonProperty("title")
@Override
public String title() {
return title;
}
@JsonProperty("description")
@Override
public String description() {
return description;
}
@JsonProperty("name")
@Override
public String name() {
return name;
}
@JsonProperty("custom_error_ttl_enabled")
@Nullable
@Override
public Boolean customErrorTTLEnabled() {
return customErrorTTLEnabled;
}
@JsonProperty("custom_error_ttl")
@Nullable
@Override
public Long customErrorTTL() {
return customErrorTTL;
}
@JsonProperty("custom_error_ttl_unit")
@Nullable
@Override
public TimeUnit customErrorTTLUnit() {
return customErrorTTLUnit;
}
@JsonProperty("content_pack")
@Nullable
@Override
public String contentPack() {
return contentPack;
}
@JsonProperty("config")
@Override
public LookupDataAdapterConfiguration config() {
return config;
}
@Override
public String toString() {
return "DataAdapterDto{"
+ "id=" + id + ", "
+ "scope=" + scope + ", "
+ "title=" + title + ", "
+ "description=" + description + ", "
+ "name=" + name + ", "
+ "customErrorTTLEnabled=" + customErrorTTLEnabled + ", "
+ "customErrorTTL=" + customErrorTTL + ", "
+ "customErrorTTLUnit=" + customErrorTTLUnit + ", "
+ "contentPack=" + contentPack + ", "
+ "config=" + config
+ "}";
}
@Override
public boolean equals(Object o) {
if (o == this) {
return true;
}
if (o instanceof DataAdapterDto) {
DataAdapterDto that = (DataAdapterDto) o;
return (this.id == null ? that.id() == null : this.id.equals(that.id()))
&& this.scope.equals(that.scope())
&& this.title.equals(that.title())
&& this.description.equals(that.description())
&& this.name.equals(that.name())
&& (this.customErrorTTLEnabled == null ? that.customErrorTTLEnabled() == null : this.customErrorTTLEnabled.equals(that.customErrorTTLEnabled()))
&& (this.customErrorTTL == null ? that.customErrorTTL() == null : this.customErrorTTL.equals(that.customErrorTTL()))
&& (this.customErrorTTLUnit == null ? that.customErrorTTLUnit() == null : this.customErrorTTLUnit.equals(that.customErrorTTLUnit()))
&& (this.contentPack == null ? that.contentPack() == null : this.contentPack.equals(that.contentPack()))
&& this.config.equals(that.config());
}
return false;
}
@Override
public int hashCode() {
int h$ = 1;
h$ *= 1000003;
h$ ^= (id == null) ? 0 : id.hashCode();
h$ *= 1000003;
h$ ^= scope.hashCode();
h$ *= 1000003;
h$ ^= title.hashCode();
h$ *= 1000003;
h$ ^= description.hashCode();
h$ *= 1000003;
h$ ^= name.hashCode();
h$ *= 1000003;
h$ ^= (customErrorTTLEnabled == null) ? 0 : customErrorTTLEnabled.hashCode();
h$ *= 1000003;
h$ ^= (customErrorTTL == null) ? 0 : customErrorTTL.hashCode();
h$ *= 1000003;
h$ ^= (customErrorTTLUnit == null) ? 0 : customErrorTTLUnit.hashCode();
h$ *= 1000003;
h$ ^= (contentPack == null) ? 0 : contentPack.hashCode();
h$ *= 1000003;
h$ ^= config.hashCode();
return h$;
}
static final class Builder extends DataAdapterDto.Builder {
private String id;
private String scope;
private String title;
private String description;
private String name;
private Boolean customErrorTTLEnabled;
private Long customErrorTTL;
private TimeUnit customErrorTTLUnit;
private String contentPack;
private LookupDataAdapterConfiguration config;
Builder() {
}
@Override
public DataAdapterDto.Builder id(String id) {
this.id = id;
return this;
}
@Override
public DataAdapterDto.Builder scope(String scope) {
if (scope == null) {
throw new NullPointerException("Null scope");
}
this.scope = scope;
return this;
}
@Override
public DataAdapterDto.Builder title(String title) {
if (title == null) {
throw new NullPointerException("Null title");
}
this.title = title;
return this;
}
@Override
public DataAdapterDto.Builder description(String description) {
if (description == null) {
throw new NullPointerException("Null description");
}
this.description = description;
return this;
}
@Override
public DataAdapterDto.Builder name(String name) {
if (name == null) {
throw new NullPointerException("Null name");
}
this.name = name;
return this;
}
@Override
public DataAdapterDto.Builder customErrorTTLEnabled(@Nullable Boolean customErrorTTLEnabled) {
this.customErrorTTLEnabled = customErrorTTLEnabled;
return this;
}
@Override
public DataAdapterDto.Builder customErrorTTL(@Nullable Long customErrorTTL) {
this.customErrorTTL = customErrorTTL;
return this;
}
@Override
public DataAdapterDto.Builder customErrorTTLUnit(@Nullable TimeUnit customErrorTTLUnit) {
this.customErrorTTLUnit = customErrorTTLUnit;
return this;
}
@Override
public DataAdapterDto.Builder contentPack(@Nullable String contentPack) {
this.contentPack = contentPack;
return this;
}
@Override
public DataAdapterDto.Builder config(LookupDataAdapterConfiguration config) {
if (config == null) {
throw new NullPointerException("Null config");
}
this.config = config;
return this;
}
@Override
public DataAdapterDto build() {
if (this.scope == null
|| this.title == null
|| this.description == null
|| this.name == null
|| this.config == null) {
StringBuilder missing = new StringBuilder();
if (this.scope == null) {
missing.append(" scope");
}
if (this.title == null) {
missing.append(" title");
}
if (this.description == null) {
missing.append(" description");
}
if (this.name == null) {
missing.append(" name");
}
if (this.config == null) {
missing.append(" config");
}
throw new IllegalStateException("Missing required properties:" + missing);
}
return new AutoValue_DataAdapterDto(
this.id,
this.scope,
this.title,
this.description,
this.name,
this.customErrorTTLEnabled,
this.customErrorTTL,
this.customErrorTTLUnit,
this.contentPack,
this.config);
}
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy