org.graylog2.contentpacks.model.constraints.AutoValue_PluginVersionConstraint Maven / Gradle / Ivy
package org.graylog2.contentpacks.model.constraints;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.vdurmont.semver4j.Requirement;
import javax.annotation.processing.Generated;
@Generated("com.google.auto.value.processor.AutoValueProcessor")
final class AutoValue_PluginVersionConstraint extends PluginVersionConstraint {
private final String type;
private final String pluginId;
private final Requirement version;
private AutoValue_PluginVersionConstraint(
String type,
String pluginId,
Requirement version) {
this.type = type;
this.pluginId = pluginId;
this.version = version;
}
@JsonProperty("type")
@Override
public String type() {
return type;
}
@JsonProperty("plugin")
@Override
public String pluginId() {
return pluginId;
}
@JsonProperty("version")
@Override
public Requirement version() {
return version;
}
@Override
public String toString() {
return "PluginVersionConstraint{"
+ "type=" + type + ", "
+ "pluginId=" + pluginId + ", "
+ "version=" + version
+ "}";
}
@Override
public boolean equals(Object o) {
if (o == this) {
return true;
}
if (o instanceof PluginVersionConstraint) {
PluginVersionConstraint that = (PluginVersionConstraint) o;
return this.type.equals(that.type())
&& this.pluginId.equals(that.pluginId())
&& this.version.equals(that.version());
}
return false;
}
@Override
public int hashCode() {
int h$ = 1;
h$ *= 1000003;
h$ ^= type.hashCode();
h$ *= 1000003;
h$ ^= pluginId.hashCode();
h$ *= 1000003;
h$ ^= version.hashCode();
return h$;
}
@Override
public PluginVersionConstraint.Builder toBuilder() {
return new Builder(this);
}
static final class Builder extends PluginVersionConstraint.Builder {
private String type;
private String pluginId;
private Requirement version;
Builder() {
}
private Builder(PluginVersionConstraint source) {
this.type = source.type();
this.pluginId = source.pluginId();
this.version = source.version();
}
@Override
public PluginVersionConstraint.Builder type(String type) {
if (type == null) {
throw new NullPointerException("Null type");
}
this.type = type;
return this;
}
@Override
public PluginVersionConstraint.Builder pluginId(String pluginId) {
if (pluginId == null) {
throw new NullPointerException("Null pluginId");
}
this.pluginId = pluginId;
return this;
}
@Override
public PluginVersionConstraint.Builder version(Requirement version) {
if (version == null) {
throw new NullPointerException("Null version");
}
this.version = version;
return this;
}
@Override
PluginVersionConstraint autoBuild() {
if (this.type == null
|| this.pluginId == null
|| this.version == null) {
StringBuilder missing = new StringBuilder();
if (this.type == null) {
missing.append(" type");
}
if (this.pluginId == null) {
missing.append(" pluginId");
}
if (this.version == null) {
missing.append(" version");
}
throw new IllegalStateException("Missing required properties:" + missing);
}
return new AutoValue_PluginVersionConstraint(
this.type,
this.pluginId,
this.version);
}
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy