in scim-spec/scim-spec-schema/src/main/java/org/apache/directory/scim/spec/resources/PhoneNumber.java [191:258]
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
PhoneNumber other = (PhoneNumber) obj;
if (isGlobalNumber != other.isGlobalNumber)
return false;
String numberWithoutVisualSeparators = number != null ? number.replaceAll(VISUAL_SEPARATORS, "") : null;
String otherNumberWithoutVisualSeparators = other.number != null ? other.number.replaceAll(VISUAL_SEPARATORS, "") : null;
if (numberWithoutVisualSeparators == null) {
if (otherNumberWithoutVisualSeparators != null)
return false;
} else if (!numberWithoutVisualSeparators.equals(otherNumberWithoutVisualSeparators))
return false;
String extensionWithoutVisualSeparators = extension != null ? extension.replaceAll(VISUAL_SEPARATORS, "") : null;
String otherExtensionWithoutVisualSeparators = other.extension != null ? other.extension.replaceAll(VISUAL_SEPARATORS, "") : null;
if (extensionWithoutVisualSeparators == null) {
if (otherExtensionWithoutVisualSeparators != null)
return false;
} else if (!extensionWithoutVisualSeparators.equals(otherExtensionWithoutVisualSeparators))
return false;
if (subAddress == null) {
if (other.subAddress != null)
return false;
} else if (!subAddress.equalsIgnoreCase(other.subAddress))
return false;
String phoneContextTemp = phoneContext;
if (!StringUtils.isBlank(phoneContext) && !isDomainPhoneContext) {
phoneContextTemp = phoneContext.replaceAll(VISUAL_SEPARATORS, "");
}
String otherPhoneContextTemp = other.phoneContext;
if (!StringUtils.isBlank(other.phoneContext) && !other.isDomainPhoneContext) {
otherPhoneContextTemp = other.phoneContext.replaceAll(VISUAL_SEPARATORS, "");
}
if (phoneContextTemp == null) {
if (otherPhoneContextTemp != null)
return false;
} else if (!phoneContextTemp.equalsIgnoreCase(otherPhoneContextTemp))
return false;
if (!equalsIgnoreCaseAndOrderParams(other.params)) {
return false;
}
if (primary == null) {
if (other.primary != null)
return false;
} else if (!primary.equals(other.primary))
return false;
if (type == null) {
if (other.type != null)
return false;
} else if (!type.equalsIgnoreCase(other.type))
return false;
return true;
}