org.graylog2.contentpacks.model.AutoValue_ModelType Maven / Gradle / Ivy
package org.graylog2.contentpacks.model;
import com.fasterxml.jackson.annotation.JsonProperty;
import javax.annotation.Generated;
@Generated("com.google.auto.value.processor.AutoValueProcessor")
final class AutoValue_ModelType extends ModelType {
private final String name;
private final String version;
private AutoValue_ModelType(
String name,
String version) {
this.name = name;
this.version = version;
}
@JsonProperty("name")
@Override
public String name() {
return name;
}
@JsonProperty("version")
@Override
public String version() {
return version;
}
@Override
public String toString() {
return "ModelType{"
+ "name=" + name + ", "
+ "version=" + version
+ "}";
}
@Override
public boolean equals(Object o) {
if (o == this) {
return true;
}
if (o instanceof ModelType) {
ModelType that = (ModelType) o;
return this.name.equals(that.name())
&& this.version.equals(that.version());
}
return false;
}
@Override
public int hashCode() {
int h$ = 1;
h$ *= 1000003;
h$ ^= name.hashCode();
h$ *= 1000003;
h$ ^= version.hashCode();
return h$;
}
static final class Builder extends ModelType.Builder {
private String name;
private String version;
Builder() {
}
@Override
public ModelType.Builder name(String name) {
if (name == null) {
throw new NullPointerException("Null name");
}
this.name = name;
return this;
}
@Override
public ModelType.Builder version(String version) {
if (version == null) {
throw new NullPointerException("Null version");
}
this.version = version;
return this;
}
@Override
public ModelType autoBuild() {
String missing = "";
if (this.name == null) {
missing += " name";
}
if (this.version == null) {
missing += " version";
}
if (!missing.isEmpty()) {
throw new IllegalStateException("Missing required properties:" + missing);
}
return new AutoValue_ModelType(
this.name,
this.version);
}
}
}