示例#1
0
  @Override
  public boolean equals(Object obj) {
    if (this == obj) return true;
    if (obj == null) return false;

    if (obj instanceof KeyPairInfo == false) return false;
    KeyPairInfo other = (KeyPairInfo) obj;

    if (other.getKeyName() == null ^ this.getKeyName() == null) return false;
    if (other.getKeyName() != null && other.getKeyName().equals(this.getKeyName()) == false)
      return false;
    if (other.getKeyFingerprint() == null ^ this.getKeyFingerprint() == null) return false;
    if (other.getKeyFingerprint() != null
        && other.getKeyFingerprint().equals(this.getKeyFingerprint()) == false) return false;
    return true;
  }