예제 #1
0
  @Override
  public int compareTo(TransitionHistory transitionHistory) {
    long primaryKey = transitionHistory.getPrimaryKey();

    if (getPrimaryKey() < primaryKey) {
      return -1;
    } else if (getPrimaryKey() > primaryKey) {
      return 1;
    } else {
      return 0;
    }
  }
예제 #2
0
  @Override
  public boolean equals(Object obj) {
    if (this == obj) {
      return true;
    }

    if (!(obj instanceof TransitionHistory)) {
      return false;
    }

    TransitionHistory transitionHistory = (TransitionHistory) obj;

    long primaryKey = transitionHistory.getPrimaryKey();

    if (getPrimaryKey() == primaryKey) {
      return true;
    } else {
      return false;
    }
  }