001/* 002 * Copyright 2020 Global Biodiversity Information Facility (GBIF) 003 * 004 * Licensed under the Apache License, Version 2.0 (the "License"); 005 * you may not use this file except in compliance with the License. 006 * You may obtain a copy of the License at 007 * 008 * http://www.apache.org/licenses/LICENSE-2.0 009 * 010 * Unless required by applicable law or agreed to in writing, software 011 * distributed under the License is distributed on an "AS IS" BASIS, 012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 013 * See the License for the specific language governing permissions and 014 * limitations under the License. 015 */ 016package org.gbif.api.model.registry; 017 018import java.io.Serializable; 019import java.util.Objects; 020 021public class Grid implements Serializable { 022 023 private Integer key; 024 private Integer totalCount; 025 private Double minDist; 026 private Integer minDistCount; 027 private Double percent; 028 private Double maxPercent; 029 030 public Grid() {} 031 032 public Integer getKey() { 033 return key; 034 } 035 036 public Integer getTotalCount() { 037 return totalCount; 038 } 039 040 public Double getMinDist() { 041 return minDist; 042 } 043 044 public Integer getMinDistCount() { 045 return minDistCount; 046 } 047 048 public Double getPercent() { 049 return percent; 050 } 051 052 public Double getMaxPercent() { 053 return maxPercent; 054 } 055 056 @Override 057 public boolean equals(Object o) { 058 if (this == o) { 059 return true; 060 } 061 if (o == null || getClass() != o.getClass()) { 062 return false; 063 } 064 Grid grid = (Grid) o; 065 return Objects.equals(key, grid.key) 066 && Objects.equals(totalCount, grid.totalCount) 067 && Objects.equals(minDist, grid.minDist) 068 && Objects.equals(minDistCount, grid.minDistCount) 069 && Objects.equals(percent, grid.percent) 070 && Objects.equals(maxPercent, grid.maxPercent); 071 } 072 073 @Override 074 public int hashCode() { 075 return Objects.hash(key, totalCount, minDist, minDistCount, percent, maxPercent); 076 } 077 078 @Override 079 public String toString() { 080 return "Grid{" + 081 "key=" + key + 082 ", totalCount=" + totalCount + 083 ", minDist=" + minDist + 084 ", minDistCount=" + minDistCount + 085 ", percent=" + percent + 086 ", maxPercent=" + maxPercent + 087 '}'; 088 } 089}