org.graylog2.lookup.AutoValue_LookupDefaultSingleValue Maven / Gradle / Ivy
package org.graylog2.lookup;
import com.fasterxml.jackson.annotation.JsonProperty;
import javax.annotation.Generated;
import javax.annotation.Nullable;
@Generated("com.google.auto.value.processor.AutoValueProcessor")
final class AutoValue_LookupDefaultSingleValue extends LookupDefaultSingleValue {
private final String valueString;
private final LookupDefaultValue.Type valueType;
private final Object value;
private AutoValue_LookupDefaultSingleValue(
String valueString,
LookupDefaultValue.Type valueType,
@Nullable Object value) {
this.valueString = valueString;
this.valueType = valueType;
this.value = value;
}
@JsonProperty(value = "value_string")
@Override
public String valueString() {
return valueString;
}
@JsonProperty(value = "value_type")
@Override
public LookupDefaultValue.Type valueType() {
return valueType;
}
@JsonProperty(value = "value")
@Nullable
@Override
public Object value() {
return value;
}
@Override
public String toString() {
return "LookupDefaultSingleValue{"
+ "valueString=" + valueString + ", "
+ "valueType=" + valueType + ", "
+ "value=" + value
+ "}";
}
@Override
public boolean equals(Object o) {
if (o == this) {
return true;
}
if (o instanceof LookupDefaultSingleValue) {
LookupDefaultSingleValue that = (LookupDefaultSingleValue) o;
return (this.valueString.equals(that.valueString()))
&& (this.valueType.equals(that.valueType()))
&& ((this.value == null) ? (that.value() == null) : this.value.equals(that.value()));
}
return false;
}
@Override
public int hashCode() {
int h = 1;
h *= 1000003;
h ^= this.valueString.hashCode();
h *= 1000003;
h ^= this.valueType.hashCode();
h *= 1000003;
h ^= (value == null) ? 0 : this.value.hashCode();
return h;
}
@Override
public LookupDefaultSingleValue.Builder toBuilder() {
return new Builder(this);
}
static final class Builder extends LookupDefaultSingleValue.Builder {
private String valueString;
private LookupDefaultValue.Type valueType;
private Object value;
Builder() {
}
private Builder(LookupDefaultSingleValue source) {
this.valueString = source.valueString();
this.valueType = source.valueType();
this.value = source.value();
}
@Override
public LookupDefaultSingleValue.Builder valueString(String valueString) {
if (valueString == null) {
throw new NullPointerException("Null valueString");
}
this.valueString = valueString;
return this;
}
@Override
public LookupDefaultSingleValue.Builder valueType(LookupDefaultValue.Type valueType) {
if (valueType == null) {
throw new NullPointerException("Null valueType");
}
this.valueType = valueType;
return this;
}
@Override
public LookupDefaultSingleValue.Builder value(@Nullable Object value) {
this.value = value;
return this;
}
@Override
public LookupDefaultSingleValue build() {
String missing = "";
if (this.valueString == null) {
missing += " valueString";
}
if (this.valueType == null) {
missing += " valueType";
}
if (!missing.isEmpty()) {
throw new IllegalStateException("Missing required properties:" + missing);
}
return new AutoValue_LookupDefaultSingleValue(
this.valueString,
this.valueType,
this.value);
}
}
}