org.graylog.plugins.pipelineprocessor.ast.functions.AutoValue_ParameterDescriptor Maven / Gradle / Ivy
package org.graylog.plugins.pipelineprocessor.ast.functions;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.function.Function;
import javax.annotation.Nullable;
import javax.annotation.processing.Generated;
@Generated("com.google.auto.value.processor.AutoValueProcessor")
final class AutoValue_ParameterDescriptor extends ParameterDescriptor {
private final Class type;
private final Class transformedType;
private final String name;
private final boolean optional;
private final Function transform;
private final String description;
private AutoValue_ParameterDescriptor(
Class type,
Class transformedType,
String name,
boolean optional,
Function transform,
@Nullable String description) {
this.type = type;
this.transformedType = transformedType;
this.name = name;
this.optional = optional;
this.transform = transform;
this.description = description;
}
@JsonProperty
@Override
public Class type() {
return type;
}
@JsonProperty
@Override
public Class transformedType() {
return transformedType;
}
@JsonProperty
@Override
public String name() {
return name;
}
@JsonProperty
@Override
public boolean optional() {
return optional;
}
@JsonIgnore
@Override
public Function transform() {
return transform;
}
@JsonProperty
@Nullable
@Override
public String description() {
return description;
}
@Override
public String toString() {
return "ParameterDescriptor{"
+ "type=" + type + ", "
+ "transformedType=" + transformedType + ", "
+ "name=" + name + ", "
+ "optional=" + optional + ", "
+ "transform=" + transform + ", "
+ "description=" + description
+ "}";
}
@Override
public boolean equals(Object o) {
if (o == this) {
return true;
}
if (o instanceof ParameterDescriptor) {
ParameterDescriptor that = (ParameterDescriptor) o;
return this.type.equals(that.type())
&& this.transformedType.equals(that.transformedType())
&& this.name.equals(that.name())
&& this.optional == that.optional()
&& this.transform.equals(that.transform())
&& (this.description == null ? that.description() == null : this.description.equals(that.description()));
}
return false;
}
@Override
public int hashCode() {
int h$ = 1;
h$ *= 1000003;
h$ ^= type.hashCode();
h$ *= 1000003;
h$ ^= transformedType.hashCode();
h$ *= 1000003;
h$ ^= name.hashCode();
h$ *= 1000003;
h$ ^= optional ? 1231 : 1237;
h$ *= 1000003;
h$ ^= transform.hashCode();
h$ *= 1000003;
h$ ^= (description == null) ? 0 : description.hashCode();
return h$;
}
static final class Builder extends ParameterDescriptor.Builder {
private Class type;
private Class transformedType;
private String name;
private Boolean optional;
private Function transform;
private String description;
Builder() {
}
@Override
public ParameterDescriptor.Builder type(Class type) {
if (type == null) {
throw new NullPointerException("Null type");
}
this.type = type;
return this;
}
@Override
public ParameterDescriptor.Builder transformedType(Class transformedType) {
if (transformedType == null) {
throw new NullPointerException("Null transformedType");
}
this.transformedType = transformedType;
return this;
}
@Override
public ParameterDescriptor.Builder name(String name) {
if (name == null) {
throw new NullPointerException("Null name");
}
this.name = name;
return this;
}
@Override
public ParameterDescriptor.Builder optional(boolean optional) {
this.optional = optional;
return this;
}
@Override
public ParameterDescriptor.Builder transform(Function transform) {
if (transform == null) {
throw new NullPointerException("Null transform");
}
this.transform = transform;
return this;
}
@Override
public Function transform() {
if (transform == null) {
throw new IllegalStateException("Property \"transform\" has not been set");
}
return transform;
}
@Override
public ParameterDescriptor.Builder description(String description) {
this.description = description;
return this;
}
@Override
ParameterDescriptor autoBuild() {
String missing = "";
if (this.type == null) {
missing += " type";
}
if (this.transformedType == null) {
missing += " transformedType";
}
if (this.name == null) {
missing += " name";
}
if (this.optional == null) {
missing += " optional";
}
if (this.transform == null) {
missing += " transform";
}
if (!missing.isEmpty()) {
throw new IllegalStateException("Missing required properties:" + missing);
}
return new AutoValue_ParameterDescriptor(
this.type,
this.transformedType,
this.name,
this.optional,
this.transform,
this.description);
}
}
}