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

com.etsy.statsd.profiler.util.Range Maven / Gradle / Ivy

There is a newer version: 2.1.0
Show newest version
package com.etsy.statsd.profiler.util;

/**
 * Represents an immutable range of integers
 */
public class Range {
    private int left;
    private int right;

    public Range(int left, int right) {
        this.left = left;
        this.right = right;
    }

    public int getLeft() {
        return left;
    }

    public int getRight() {
        return right;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        Range range = (Range) o;

        return left == range.left && right == range.right;

    }

    @Override
    public int hashCode() {
        int result = left;
        result = 31 * result + right;
        return result;
    }

    @Override
    public String toString() {
        return "Range{" +
                "left=" + left +
                ", right=" + right +
                '}';
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy