コード例 #1
0
ファイル: GroupSymbolImpl.java プロジェクト: vhalbert/komodo
  @Override
  public boolean equals(Object obj) {
    if (this == obj) return true;

    if (!super.equals(obj)) return false;
    if (getClass() != obj.getClass()) return false;
    GroupSymbolImpl other = (GroupSymbolImpl) obj;
    if (this.schema == null || other.schema == null) {
      if (getTeiidVersion().isLessThan(Version.TEIID_8_0.get())) {
        return this.getCanonicalName().equals(other.getCanonicalName());
      } else {
        return this.getName().equals(other.getName());
      }
    }

    if (this.schema == null) {
      if (other.schema != null) return false;
    } else if (!this.schema.equals(other.schema)) return false;

    if (getTeiidVersion().isLessThan(Version.TEIID_8_0.get()))
      return this.getShortCanonicalName().equals(other.getShortCanonicalName());

    return this.getShortName().equals(other.getShortName());
  }
コード例 #2
0
ファイル: GroupSymbolImpl.java プロジェクト: vhalbert/komodo
  @Override
  public int hashCode() {
    final int prime = 31;
    int result = 1;
    if (this.schema != null) {
      result = prime * result + this.schema.hashCode();
      if (getTeiidVersion().isLessThan(Version.TEIID_8_0.get()))
        result =
            prime * result + ((this.getShortName() == null) ? 0 : this.getShortName().hashCode());
      else
        result =
            prime * result
                + ((this.getShortCanonicalName() == null)
                    ? 0
                    : this.getShortCanonicalName().hashCode());

      return result;
    }

    return super.hashCode();
  }