use of org.apache.commons.lang3.builder.HashCodeBuilder in project cas by apereo.
the class DefaultHandlerResult method hashCode.
@Override
public int hashCode() {
final HashCodeBuilder builder = new HashCodeBuilder(109, 31);
builder.append(this.handlerName);
builder.append(this.credentialMetaData);
builder.append(this.principal);
builder.append(this.warnings);
return builder.toHashCode();
}
use of org.apache.commons.lang3.builder.HashCodeBuilder in project cas by apereo.
the class DefaultMessageDescriptor method hashCode.
@Override
public int hashCode() {
final HashCodeBuilder builder = new HashCodeBuilder(99, 31);
builder.append(this.code);
builder.append(this.defaultMessage);
builder.append(this.params);
return builder.toHashCode();
}
use of org.apache.commons.lang3.builder.HashCodeBuilder in project cas by apereo.
the class ImmutableAssertion method hashCode.
@Override
public int hashCode() {
final HashCodeBuilder builder = new HashCodeBuilder(15, 11);
builder.append(this.primaryAuthentication);
builder.append(this.chainedAuthentications);
builder.append(this.service);
builder.append(this.fromNewLogin);
return builder.toHashCode();
}
use of org.apache.commons.lang3.builder.HashCodeBuilder in project OpenAttestation by OpenAttestation.
the class ArrayCertificateRepository method hashCode.
/**
* Calculates the hash code based on the order and contents of the
* certificates in the repository. Two Array Certficate Repository objects
* are considered equal if they have the same certificates in the same
* order.
* We might relax the order requirement in the future.
* The hash code is only calculated once, after that it is cached and
* reused. This assumes the repository will not be modified outside
* of this object, and since it's presented as a read-only repository that is not likely
* to happen.
* @return
*/
@Override
public int hashCode() {
// use cached value when possible
if (hashCode != null) {
return hashCode;
}
HashCodeBuilder builder = new HashCodeBuilder(11, 31);
if (keystore != null) {
for (int i = 0; i < keystore.length; i++) {
try {
builder.append(keystore[i].getEncoded());
} catch (Exception e) {
builder.append(e.toString());
}
}
}
hashCode = builder.toHashCode();
return hashCode;
}
use of org.apache.commons.lang3.builder.HashCodeBuilder in project OpenAttestation by OpenAttestation.
the class KeystoreCertificateRepository method hashCode.
/**
* Calculates the hash code based on the order and contents of the
* certificates in the repository. Two Array Certficate Repository objects
* are considered equal if they have the same certificates in the same
* order.
* We might relax the order requirement in the future.
* The hash code is only calculated once, after that it is cached and
* reused. This assumes the repository will not be modified outside
* of this object, and since it's presented as a read-only repository that is not likely
* to happen.
* @return
*/
@Override
public int hashCode() {
// use cached value when possible
if (hashCode != null) {
return hashCode;
}
HashCodeBuilder builder = new HashCodeBuilder(11, 37);
if (keystore != null) {
List<X509Certificate> certificates = getCertificates();
Collections.sort(certificates, new X509CertificateComparator());
for (X509Certificate certificate : certificates) {
try {
builder.append(certificate.getEncoded());
} catch (Exception e) {
builder.append(e.toString());
}
}
}
hashCode = builder.toHashCode();
return hashCode;
}
Aggregations