@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getContinentCode() == null) ? 0 : getContinentCode().hashCode()); hashCode = prime * hashCode + ((getContinentName() == null) ? 0 : getContinentName().hashCode()); hashCode = prime * hashCode + ((getCountryCode() == null) ? 0 : getCountryCode().hashCode()); hashCode = prime * hashCode + ((getCountryName() == null) ? 0 : getCountryName().hashCode()); hashCode = prime * hashCode + ((getSubdivisionCode() == null) ? 0 : getSubdivisionCode().hashCode()); hashCode = prime * hashCode + ((getSubdivisionName() == null) ? 0 : getSubdivisionName().hashCode()); return hashCode; }
/** * Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be * redacted from this string using a placeholder value. * * @return A string representation of this object. * * @see java.lang.Object#toString() */ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("{"); if (getContinentCode() != null) sb.append("ContinentCode: ").append(getContinentCode()).append(","); if (getContinentName() != null) sb.append("ContinentName: ").append(getContinentName()).append(","); if (getCountryCode() != null) sb.append("CountryCode: ").append(getCountryCode()).append(","); if (getCountryName() != null) sb.append("CountryName: ").append(getCountryName()).append(","); if (getSubdivisionCode() != null) sb.append("SubdivisionCode: ").append(getSubdivisionCode()).append(","); if (getSubdivisionName() != null) sb.append("SubdivisionName: ").append(getSubdivisionName()); sb.append("}"); return sb.toString(); }
if (other.getCountryName() != null && other.getCountryName().equals(this.getCountryName()) == false) return false; if (other.getSubdivisionCode() == null ^ this.getSubdivisionCode() == null) return false; if (other.getSubdivisionCode() != null && other.getSubdivisionCode().equals(this.getSubdivisionCode()) == false) return false; if (other.getSubdivisionName() == null ^ this.getSubdivisionName() == null)