/**
* =============================================================================
*
* 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.record_rc3;
import java.io.Serializable;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
import org.orcid.jaxb.model.common_rc3.CreatedDate;
import org.orcid.jaxb.model.common_rc3.LastModifiedDate;
import org.orcid.jaxb.model.common_rc3.Visibility;
import org.orcid.jaxb.model.common_rc3.VisibilityType;
/**
*
* @author Angel Montenegro
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(propOrder = { "createdDate", "lastModifiedDate", "content" })
@XmlRootElement(name = "biography", namespace = "http://www.orcid.org/ns/personal-details")
public class Biography implements Serializable, VisibilityType {
private static final long serialVersionUID = 1L;
@XmlElement(namespace = "http://www.orcid.org/ns/common", name = "last-modified-date")
protected LastModifiedDate lastModifiedDate;
@XmlElement(name = "created-date", namespace = "http://www.orcid.org/ns/common")
protected CreatedDate createdDate;
@XmlElement(name = "content", namespace = "http://www.orcid.org/ns/personal-details")
protected String content;
@XmlAttribute
protected Visibility visibility;
@XmlAttribute
protected String path;
public Biography() {
}
public Biography(String content) {
this.content = content;
}
public Biography(String content, Visibility visibility) {
this.content = content;
this.visibility = visibility;
}
public LastModifiedDate getLastModifiedDate() {
return lastModifiedDate;
}
public void setLastModifiedDate(LastModifiedDate lastModifiedDate) {
this.lastModifiedDate = lastModifiedDate;
}
public String getContent() {
return content;
}
public void setContent(String content) {
this.content = content;
}
public Visibility getVisibility() {
return visibility;
}
public void setVisibility(Visibility visibility) {
this.visibility = visibility;
}
public String getPath() {
return path;
}
public void setPath(String path) {
this.path = path;
}
public CreatedDate getCreatedDate() {
return createdDate;
}
public void setCreatedDate(CreatedDate createdDate) {
this.createdDate = createdDate;
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((content == null) ? 0 : content.hashCode());
result = prime * result + ((createdDate == null) ? 0 : createdDate.hashCode());
result = prime * result + ((lastModifiedDate == null) ? 0 : lastModifiedDate.hashCode());
result = prime * result + ((path == null) ? 0 : path.hashCode());
result = prime * result + ((visibility == null) ? 0 : visibility.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;
Biography other = (Biography) obj;
if (content == null) {
if (other.content != null)
return false;
} else if (!content.equals(other.content))
return false;
if (createdDate == null) {
if (other.createdDate != null)
return false;
} else if (!createdDate.equals(other.createdDate))
return false;
if (lastModifiedDate == null) {
if (other.lastModifiedDate != null)
return false;
} else if (!lastModifiedDate.equals(other.lastModifiedDate))
return false;
if (path == null) {
if (other.path != null)
return false;
} else if (!path.equals(other.path))
return false;
if (visibility != other.visibility)
return false;
return true;
}
}