Пример #1
0
  @Override
  public boolean equals(Object obj) {
    if (this == obj) {
      return true;
    }
    if (obj == null) {
      return false;
    }
    if (!(obj instanceof LongSMSMessage)) {
      return false;
    }
    LongSMSMessage other = (LongSMSMessage) obj;
    if (count != other.count) {
      return false;
    }
    if (random != other.random) {
      return false;
    }
    if (!getSrcId().equals(other.getSrcId())) {
      return false;
    }
    if (!Arrays.equals(getDestId(), other.getDestId())) {
      return false;
    }

    return true;
  }
Пример #2
0
 @Override
 public int compareTo(LongSMSMessage o) {
   if (this.sequence > o.getSequence()) {
     return 1;
   } else if (this.sequence == o.getSequence()) {
     return 0;
   } else {
     return -1;
   }
 }