org.graylog2.lookup.AutoValue_LookupDefaultSingleValue Maven / Gradle / Ivy
package org.graylog2.lookup;
import com.fasterxml.jackson.annotation.JsonProperty;
import javax.annotation.Nullable;
import javax.annotation.processing.Generated;
@Generated("com.google.auto.value.processor.AutoValueProcessor")
final class AutoValue_LookupDefaultSingleValue extends LookupDefaultSingleValue {
private final String valueString;
private final LookupDefaultValue.Type valueType;
@Nullable
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_string")
@Override
public String valueString() {
return valueString;
}
@JsonProperty("value_type")
@Override
public LookupDefaultValue.Type valueType() {
return valueType;
}
@JsonProperty("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$ ^= valueString.hashCode();
h$ *= 1000003;
h$ ^= valueType.hashCode();
h$ *= 1000003;
h$ ^= (value == null) ? 0 : 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() {
if (this.valueString == null
|| this.valueType == null) {
StringBuilder missing = new StringBuilder();
if (this.valueString == null) {
missing.append(" valueString");
}
if (this.valueType == null) {
missing.append(" valueType");
}
throw new IllegalStateException("Missing required properties:" + missing);
}
return new AutoValue_LookupDefaultSingleValue(
this.valueString,
this.valueType,
this.value);
}
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy