| | |
| | | } |
| | | } |
| | | |
| | | // TODO : reminder : should add this method in the SDK |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public int hashCode() |
| | | { |
| | | int hashCode = 0; |
| | | if (normInitial != null) |
| | | { |
| | | hashCode += normInitial.hashCode(); |
| | | } |
| | | if (normAnys != null) |
| | | { |
| | | for (ByteString any : normAnys) |
| | | { |
| | | hashCode += any.hashCode(); |
| | | } |
| | | } |
| | | if (normFinal != null) |
| | | { |
| | | hashCode += normFinal.hashCode(); |
| | | } |
| | | return hashCode; |
| | | } |
| | | |
| | | // TODO : reminder : should add this method in the SDK |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean equals(Object obj) |
| | | { |
| | | if (obj == this) |
| | | { |
| | | return true; |
| | | } |
| | | if (! (obj instanceof DefaultSubstringAssertion)) |
| | | { |
| | | return false; |
| | | } |
| | | DefaultSubstringAssertion other = (DefaultSubstringAssertion) obj; |
| | | boolean initialCheck = normInitial == null ? other.normInitial == null : normInitial.equals(other.normInitial); |
| | | if (!initialCheck) |
| | | { |
| | | return false; |
| | | } |
| | | boolean finalCheck = normFinal == null ? other.normFinal == null : normFinal.equals(other.normFinal); |
| | | if (!finalCheck) |
| | | { |
| | | return false; |
| | | } |
| | | boolean anyCheck = normAnys == null ? other.normAnys == null : normAnys.length == other.normAnys.length; |
| | | if (!anyCheck) |
| | | { |
| | | return false; |
| | | } |
| | | if (normAnys != null) |
| | | { |
| | | for (int i = 0; i < normAnys.length; i++) |
| | | { |
| | | if (! normAnys[i].equals(other.normAnys[i])) |
| | | { |
| | | return false; |
| | | } |
| | | } |
| | | } |
| | | return true; |
| | | } |
| | | |
| | | } |
| | | |
| | | /** {@inheritDoc} */ |