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

org.molgenis.data.Range Maven / Gradle / Ivy

There is a newer version: 8.4.5
Show newest version
package org.molgenis.data;

/** Long range, min and max included */
public class Range {
  private final Long min;
  private final Long max;

  public Range(Long min, Long max) {
    this.min = min;
    this.max = max;
  }

  public Long getMin() {
    return min;
  }

  public Long getMax() {
    return max;
  }

  @Override
  public int hashCode() {
    final int prime = 31;
    int result = 1;
    result = prime * result + ((max == null) ? 0 : max.hashCode());
    result = prime * result + ((min == null) ? 0 : min.hashCode());
    return result;
  }

  @Override
  public boolean equals(Object obj) {
    if (this == obj) return true;
    if (obj == null) return false;
    if (getClass() != obj.getClass()) return false;
    Range other = (Range) obj;
    if (max == null) {
      if (other.max != null) return false;
    } else if (!max.equals(other.max)) return false;
    if (min == null) {
      if (other.min != null) return false;
    } else if (!min.equals(other.min)) return false;
    return true;
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy