All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.graylog2.contentpacks.model.constraints.AutoValue_GraylogVersionConstraint Maven / Gradle / Ivy

There is a newer version: 6.1.4
Show newest version
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_GraylogVersionConstraint extends GraylogVersionConstraint {

  private final String type;

  private final Requirement version;

  private AutoValue_GraylogVersionConstraint(
      String type,
      Requirement version) {
    this.type = type;
    this.version = version;
  }

  @JsonProperty("type")
  @Override
  public String type() {
    return type;
  }

  @JsonProperty("version")
  @Override
  public Requirement version() {
    return version;
  }

  @Override
  public String toString() {
    return "GraylogVersionConstraint{"
        + "type=" + type + ", "
        + "version=" + version
        + "}";
  }

  @Override
  public boolean equals(Object o) {
    if (o == this) {
      return true;
    }
    if (o instanceof GraylogVersionConstraint) {
      GraylogVersionConstraint that = (GraylogVersionConstraint) o;
      return this.type.equals(that.type())
          && this.version.equals(that.version());
    }
    return false;
  }

  @Override
  public int hashCode() {
    int h$ = 1;
    h$ *= 1000003;
    h$ ^= type.hashCode();
    h$ *= 1000003;
    h$ ^= version.hashCode();
    return h$;
  }

  @Override
  public GraylogVersionConstraint.Builder toBuilder() {
    return new Builder(this);
  }

  static final class Builder extends GraylogVersionConstraint.Builder {
    private String type;
    private Requirement version;
    Builder() {
    }
    private Builder(GraylogVersionConstraint source) {
      this.type = source.type();
      this.version = source.version();
    }
    @Override
    public GraylogVersionConstraint.Builder type(String type) {
      if (type == null) {
        throw new NullPointerException("Null type");
      }
      this.type = type;
      return this;
    }
    @Override
    public GraylogVersionConstraint.Builder version(Requirement version) {
      if (version == null) {
        throw new NullPointerException("Null version");
      }
      this.version = version;
      return this;
    }
    @Override
    GraylogVersionConstraint autoBuild() {
      if (this.type == null
          || this.version == null) {
        StringBuilder missing = new StringBuilder();
        if (this.type == null) {
          missing.append(" type");
        }
        if (this.version == null) {
          missing.append(" version");
        }
        throw new IllegalStateException("Missing required properties:" + missing);
      }
      return new AutoValue_GraylogVersionConstraint(
          this.type,
          this.version);
    }
  }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy