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

hydra.ext.org.geojson.model.Polygon Maven / Gradle / Ivy

There is a newer version: 0.8.1
Show newest version
// Note: this is an automatically generated file. Do not edit.

package hydra.ext.org.geojson.model;

import java.io.Serializable;

/**
 * For type "Polygon", the "coordinates" member MUST be an array of linear ring coordinate arrays.
 * For Polygons with more than one of these rings, the first MUST be the exterior ring, and any others MUST be interior rings.  The exterior ring bounds the surface, and the interior rings (if present) bound holes within the surface.
 */
public class Polygon implements Serializable {
  public static final hydra.core.Name TYPE_NAME = new hydra.core.Name("hydra/ext/org/geojson/model.Polygon");
  
  public static final hydra.core.Name FIELD_NAME_COORDINATES = new hydra.core.Name("coordinates");
  
  public static final hydra.core.Name FIELD_NAME_BBOX = new hydra.core.Name("bbox");
  
  public final java.util.List coordinates;
  
  public final hydra.util.Opt bbox;
  
  public Polygon (java.util.List coordinates, hydra.util.Opt bbox) {
    java.util.Objects.requireNonNull((coordinates));
    java.util.Objects.requireNonNull((bbox));
    this.coordinates = coordinates;
    this.bbox = bbox;
  }
  
  @Override
  public boolean equals(Object other) {
    if (!(other instanceof Polygon)) {
      return false;
    }
    Polygon o = (Polygon) (other);
    return coordinates.equals(o.coordinates) && bbox.equals(o.bbox);
  }
  
  @Override
  public int hashCode() {
    return 2 * coordinates.hashCode() + 3 * bbox.hashCode();
  }
  
  public Polygon withCoordinates(java.util.List coordinates) {
    java.util.Objects.requireNonNull((coordinates));
    return new Polygon(coordinates, bbox);
  }
  
  public Polygon withBbox(hydra.util.Opt bbox) {
    java.util.Objects.requireNonNull((bbox));
    return new Polygon(coordinates, bbox);
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy