/** * ============================================================================= * * 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.record.summary_rc4; 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_rc4.CreatedDate; import org.orcid.jaxb.model.common_rc4.Filterable; import org.orcid.jaxb.model.common_rc4.LastModifiedDate; import org.orcid.jaxb.model.common_rc4.PublicationDate; import org.orcid.jaxb.model.common_rc4.Source; import org.orcid.jaxb.model.common_rc4.Visibility; import org.orcid.jaxb.model.record_rc4.Activity; import org.orcid.jaxb.model.record_rc4.ExternalIDs; import org.orcid.jaxb.model.record_rc4.GroupableActivity; import org.orcid.jaxb.model.record_rc4.SourceAware; import org.orcid.jaxb.model.record_rc4.WorkTitle; import org.orcid.jaxb.model.record_rc4.WorkType; /** * <p> * Java class for anonymous complex type. * * <p> * The following schema fragment specifies the expected content contained within * this class. * * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(propOrder = { "putCode", "createdDate", "lastModifiedDate", "source", "title", "externalIdentifiers", "type", "publicationDate" }) @XmlRootElement(name = "work-summary", namespace = "http://www.orcid.org/ns/work") public class WorkSummary implements Filterable, Activity, GroupableActivity, Serializable, SourceAware { private static final long serialVersionUID = 1L; @XmlElement(namespace = "http://www.orcid.org/ns/work") protected WorkTitle title; @XmlElement(namespace = "http://www.orcid.org/ns/work") protected WorkType type; @XmlElement(name = "publication-date", namespace = "http://www.orcid.org/ns/common") protected PublicationDate publicationDate; @XmlElement(name = "external-ids", namespace = "http://www.orcid.org/ns/common") protected ExternalIDs externalIdentifiers; @XmlElement(namespace = "http://www.orcid.org/ns/common") protected Source source; @XmlElement(name = "last-modified-date", namespace = "http://www.orcid.org/ns/common") protected LastModifiedDate lastModifiedDate; @XmlElement(name = "created-date", namespace = "http://www.orcid.org/ns/common") protected CreatedDate createdDate; @XmlAttribute(name = "put-code") protected Long putCode; @XmlAttribute(name="path") protected String path; @XmlAttribute protected Visibility visibility; @XmlAttribute(name = "display-index") protected String displayIndex; public WorkTitle getTitle() { return title; } public void setTitle(WorkTitle title) { this.title = title; } public WorkType getType() { return type; } public void setType(WorkType type) { this.type = type; } public PublicationDate getPublicationDate() { return publicationDate; } public void setPublicationDate(PublicationDate publicationDate) { this.publicationDate = publicationDate; } public ExternalIDs getExternalIdentifiers() { return externalIdentifiers; } public void setExternalIdentifiers(ExternalIDs externalIdentifiers) { this.externalIdentifiers = externalIdentifiers; } public Source getSource() { return source; } public void setSource(Source source) { this.source = source; } public Long getPutCode() { return putCode; } public void setPutCode(Long putCode) { this.putCode = putCode; } /** * Gets the value of the path property. * * @return possible object is {@link Object } * */ public String getPath() { return path; } /** * Sets the value of the path property. * * @param path * allowed object is {@link Object } * */ public void setPath(String path) { this.path = path; } public Visibility getVisibility() { return visibility; } public void setVisibility(Visibility visibility) { this.visibility = visibility; } public LastModifiedDate getLastModifiedDate() { return lastModifiedDate; } public void setLastModifiedDate(LastModifiedDate lastModifiedDate) { this.lastModifiedDate = lastModifiedDate; } public CreatedDate getCreatedDate() { return createdDate; } public void setCreatedDate(CreatedDate createdDate) { this.createdDate = createdDate; } public static long getSerialversionuid() { return serialVersionUID; } public String getDisplayIndex() { return displayIndex; } public void setDisplayIndex(String displayIndex) { this.displayIndex = displayIndex; } @Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((createdDate == null) ? 0 : createdDate.hashCode()); result = prime * result + ((externalIdentifiers == null) ? 0 : externalIdentifiers.hashCode()); result = prime * result + ((lastModifiedDate == null) ? 0 : lastModifiedDate.hashCode()); result = prime * result + ((publicationDate == null) ? 0 : publicationDate.hashCode()); result = prime * result + ((putCode == null) ? 0 : putCode.hashCode()); result = prime * result + ((source == null) ? 0 : source.hashCode()); result = prime * result + ((title == null) ? 0 : title.hashCode()); result = prime * result + ((type == null) ? 0 : type.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; WorkSummary other = (WorkSummary) obj; if (createdDate == null) { if (other.createdDate != null) return false; } else if (!createdDate.equals(other.createdDate)) return false; if (externalIdentifiers == null) { if (other.externalIdentifiers != null) return false; } else if (!externalIdentifiers.equals(other.externalIdentifiers)) return false; if (lastModifiedDate == null) { if (other.lastModifiedDate != null) return false; } else if (!lastModifiedDate.equals(other.lastModifiedDate)) return false; if (publicationDate == null) { if (other.publicationDate != null) return false; } else if (!publicationDate.equals(other.publicationDate)) return false; if (putCode == null) { if (other.putCode != null) return false; } else if (!putCode.equals(other.putCode)) return false; if (source == null) { if (other.source != null) return false; } else if (!source.equals(other.source)) return false; if (title == null) { if (other.title != null) return false; } else if (!title.equals(other.title)) return false; if (type != other.type) return false; if (visibility != other.visibility) return false; return true; } /** * Gets the value of the workSources property. * * @return possible object is {@link WorkSource } * */ @Override public String retrieveSourcePath() { if (source != null) { return source.retrieveSourcePath(); } return null; } @Override public int compareTo(GroupableActivity activity) { Long index = Long.valueOf(this.getDisplayIndex() == null ? "0" : this.getDisplayIndex()); Long otherIndex = Long.valueOf(activity.getDisplayIndex() == null ? "0" : activity.getDisplayIndex()); if (index == null) { if (otherIndex == null) { return 0; } else { return -1; } } else { if (otherIndex == null) { return 1; } else if (index instanceof Comparable) { // Return opposite, since higher index goes first return index.compareTo(otherIndex) * -1; } else { return 0; } } } }