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

org.graylog.plugins.views.search.views.widgets.aggregation.AutoValue_Viewport Maven / Gradle / Ivy

There is a newer version: 5.2.7
Show newest version


package org.graylog.plugins.views.search.views.widgets.aggregation;

import com.fasterxml.jackson.annotation.JsonProperty;
import javax.annotation.Generated;

@Generated("com.google.auto.value.processor.AutoValueProcessor")
final class AutoValue_Viewport extends Viewport {

  private final double centerX;

  private final double centerY;

  private final int zoom;

  private AutoValue_Viewport(
      double centerX,
      double centerY,
      int zoom) {
    this.centerX = centerX;
    this.centerY = centerY;
    this.zoom = zoom;
  }

  @JsonProperty(value = "center_x")
  @Override
  public double centerX() {
    return centerX;
  }

  @JsonProperty(value = "center_y")
  @Override
  public double centerY() {
    return centerY;
  }

  @JsonProperty
  @Override
  public int zoom() {
    return zoom;
  }

  @Override
  public String toString() {
    return "Viewport{"
         + "centerX=" + centerX + ", "
         + "centerY=" + centerY + ", "
         + "zoom=" + zoom
        + "}";
  }

  @Override
  public boolean equals(Object o) {
    if (o == this) {
      return true;
    }
    if (o instanceof Viewport) {
      Viewport that = (Viewport) o;
      return (Double.doubleToLongBits(this.centerX) == Double.doubleToLongBits(that.centerX()))
           && (Double.doubleToLongBits(this.centerY) == Double.doubleToLongBits(that.centerY()))
           && (this.zoom == that.zoom());
    }
    return false;
  }

  @Override
  public int hashCode() {
    int h$ = 1;
    h$ *= 1000003;
    h$ ^= (int) ((Double.doubleToLongBits(centerX) >>> 32) ^ Double.doubleToLongBits(centerX));
    h$ *= 1000003;
    h$ ^= (int) ((Double.doubleToLongBits(centerY) >>> 32) ^ Double.doubleToLongBits(centerY));
    h$ *= 1000003;
    h$ ^= zoom;
    return h$;
  }

  static final class Builder extends Viewport.Builder {
    private Double centerX;
    private Double centerY;
    private Integer zoom;
    Builder() {
    }
    @Override
    public Viewport.Builder centerX(double centerX) {
      this.centerX = centerX;
      return this;
    }
    @Override
    public Viewport.Builder centerY(double centerY) {
      this.centerY = centerY;
      return this;
    }
    @Override
    public Viewport.Builder zoom(int zoom) {
      this.zoom = zoom;
      return this;
    }
    @Override
    public Viewport build() {
      String missing = "";
      if (this.centerX == null) {
        missing += " centerX";
      }
      if (this.centerY == null) {
        missing += " centerY";
      }
      if (this.zoom == null) {
        missing += " zoom";
      }
      if (!missing.isEmpty()) {
        throw new IllegalStateException("Missing required properties:" + missing);
      }
      return new AutoValue_Viewport(
          this.centerX,
          this.centerY,
          this.zoom);
    }
  }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy