/**
* =============================================================================
*
* ORCID (R) Open Source
* http://orcid.org
*
* Copyright (c) 2012-2014 ORCID, Inc.
* Licensed under an MIT-Style License (MIT)
* http://orcid.org/open-source-license
*
* This copyright and license information (including a link to the full license)
* shall be included in its entirety in all copies or substantial portion of
* the software.
*
* =============================================================================
*/
//
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2012.08.09 at 01:52:56 PM BST
//
package org.orcid.jaxb.model.message;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
import java.io.Serializable;
/**
* <p>
* Java class for anonymous complex type.
*
* <p>
* The following schema fragment specifies the expected content contained within
* this class.
*
* <pre>
* <complexType>
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <element ref="{http://www.orcid.org/ns/orcid}given-names"/>
* <element ref="{http://www.orcid.org/ns/orcid}family-name"/>
* <element ref="{http://www.orcid.org/ns/orcid}credit-name" minOccurs="0"/>
* <element ref="{http://www.orcid.org/ns/orcid}other-names" minOccurs="0"/>
* </sequence>
* <attGroup ref="{http://www.orcid.org/ns/orcid}visibility"/>
* </restriction>
* </complexContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(propOrder = { "givenNames", "familyName", "creditName", "otherNames" })
@XmlRootElement(name = "personal-details")
public class PersonalDetails implements Serializable {
/**
*
*/
private static final long serialVersionUID = 1L;
@XmlElement(name = "given-names", required = true)
protected GivenNames givenNames;
@XmlElement(name = "family-name", required = true)
protected FamilyName familyName;
@XmlElement(name = "credit-name")
protected CreditName creditName;
@XmlElement(name = "other-names")
protected OtherNames otherNames;
/**
* Gets the value of the givenNames property.
*
* @return possible object is {@link GivenNames }
*
*/
public GivenNames getGivenNames() {
return givenNames;
}
/**
* Sets the value of the givenNames property.
*
* @param value
* allowed object is {@link GivenNames }
*
*/
public void setGivenNames(GivenNames value) {
this.givenNames = value;
}
/**
* Gets the value of the familyName property.
*
* @return possible object is {@link FamilyName }
*
*/
public FamilyName getFamilyName() {
return familyName;
}
/**
* Sets the value of the familyName property.
*
* @param value
* allowed object is {@link FamilyName }
*
*/
public void setFamilyName(FamilyName value) {
this.familyName = value;
}
/**
* Gets the value of the creditName property.
*
* @return possible object is {@link CreditName }
*
*/
public CreditName getCreditName() {
return creditName;
}
/**
* Sets the value of the creditName property.
*
* @param value
* allowed object is {@link CreditName }
*
*/
public void setCreditName(CreditName value) {
this.creditName = value;
}
/**
* Gets the value of the otherNames property.
*
* @return possible object is {@link OtherNames }
*
*/
public OtherNames getOtherNames() {
return otherNames;
}
/**
* Sets the value of the otherNames property.
*
* @param value
* allowed object is {@link OtherNames }
*
*/
public void setOtherNames(OtherNames value) {
this.otherNames = value;
}
public String retrieveDisplayNameIgnoringVisibility() {
if (creditName != null) {
return creditName.getContent();
}
StringBuilder builder = new StringBuilder();
builder.append(givenNames.getContent());
if (familyName != null) {
builder.append(" ");
builder.append(familyName.getContent());
}
return builder.toString();
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((creditName == null) ? 0 : creditName.hashCode());
result = prime * result + ((familyName == null) ? 0 : familyName.hashCode());
result = prime * result + ((givenNames == null) ? 0 : givenNames.hashCode());
result = prime * result + ((otherNames == null) ? 0 : otherNames.hashCode());
return result;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
PersonalDetails other = (PersonalDetails) obj;
if (creditName == null) {
if (other.creditName != null)
return false;
} else if (!creditName.equals(other.creditName))
return false;
if (familyName == null) {
if (other.familyName != null)
return false;
} else if (!familyName.equals(other.familyName))
return false;
if (givenNames == null) {
if (other.givenNames != null)
return false;
} else if (!givenNames.equals(other.givenNames))
return false;
if (otherNames == null) {
if (other.otherNames != null)
return false;
} else if (!otherNames.equals(other.otherNames))
return false;
return true;
}
}