/**
* =============================================================================
*
* 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.
*
* =============================================================================
*/
package org.orcid.jaxb.model.message;
import java.io.Serializable;
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;
/**
* <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}orcid" minOccurs="0"/>
* <element ref="{http://www.orcid.org/ns/orcid}orcid-id" minOccurs="0"/>
* </sequence>
* </restriction>
* </complexContent>
* </complexType>
* </pre>
*
* @author Angel Montenegro
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType( propOrder = { "orcid", "orcidId", "orcidIdentifier" })
@XmlRootElement(name = "primary-record")
public class PrimaryRecord implements Serializable {
/**
* Autogenerated serial version uid
*/
private static final long serialVersionUID = 8691353462048542411L;
@XmlElement(name = "orcid")
protected Orcid orcid;
@XmlElement(name = "orcid-id")
protected Url orcidId;
@XmlElement(name = "orcid-identifier")
protected OrcidIdentifier orcidIdentifier;
public Orcid getOrcid() {
return orcid;
}
public void setOrcid(Orcid orcid) {
this.orcid = orcid;
}
public Url getOrcidId() {
return orcidId;
}
public void setOrcidId(Url orcidId) {
this.orcidId = orcidId;
}
public OrcidIdentifier getOrcidIdentifier() {
return orcidIdentifier;
}
public void setOrcidIdentifier(OrcidIdentifier orcidIdentifier) {
this.orcidIdentifier = orcidIdentifier;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
PrimaryRecord other = (PrimaryRecord) obj;
if (orcid == null) {
if (other.getOrcid() != null)
return false;
}
if (!orcid.equals(other.getOrcid()))
return false;
if (orcidId == null) {
if (other.getOrcidId() != null)
return false;
}
if (!orcidId.equals(other.getOrcidId()))
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((orcid == null) ? 0 : orcid.hashCode());
result = prime * result + ((orcidId == null) ? 0 : orcidId.hashCode());
return result;
}
}