class CRange implements WritableComparable<CRange> {

  @Override
  public boolean equals(Object other) {
    LexicographicBytesComparator bytesComparator = LexicographicBytesComparator.INSTANCE;
    if (!(other instanceof CRange)) {
      return false;
    }

    CRange compare = (CRange) other;

    if ((start == null && compare.start != null) || end == null
        && compare.end != null) {
      return false;
    }

    if ((start != null && compare.start == null) || end != null
        && compare.end == null) {
      return false;
    }
    if (bytesComparator.compare(start, compare.start) == 0) {
      if (startInclusive == compare.startInclusive) {
        if (bytesComparator.compare(end, compare.end) == 0) {
          if (endInclusive == compare.endInclusive) {
            return true;
          }
        }
      }
    }

    return false;
  }

  public  CRange();
  public  CRange(byte[] start);
  public  CRange(byte[] start, byte[] end);
  public  CRange(byte[] start, boolean startInclusive, byte[] end,
      boolean endInclusive);

}