public org.orcid.jaxb.model.message.Citation toCitiation() { org.orcid.jaxb.model.message.Citation c = new org.orcid.jaxb.model.message.Citation(); if (this.getCitation() != null) c.setCitation(this.getCitation().getValue()); if (!PojoUtil.isEmpty(this.getCitationType())) c.setWorkCitationType(CitationType.fromValue(this.getCitationType().getValue())); return c; }
public static Citation valueOf(org.orcid.jaxb.model.message.Citation citation) { Citation c = new Citation(); if (citation.getCitation() != null) { Text cText = new Text(); cText.setValue(citation.getCitation()); c.setCitation(cText); } if (citation.getWorkCitationType() != null) { Text ctText = new Text(); ctText.setValue(citation.getWorkCitationType().value()); c.setCitationType(ctText); } return c; }
/** * Note that put-code is not part of hashcode. This is important for avoid * creation of duplication works. */ @Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((publicationDate == null) ? 0 : publicationDate.hashCode()); result = prime * result + ((shortDescription == null) ? 0 : shortDescription.hashCode()); result = prime * result + ((url == null) ? 0 : url.hashCode()); result = prime * result + ((visibility == null) ? 0 : visibility.hashCode()); result = prime * result + ((workCitation == null) ? 0 : workCitation.hashCode()); result = prime * result + ((workContributors == null) ? 0 : workContributors.hashCode()); result = prime * result + ((workExternalIdentifiers == null) ? 0 : workExternalIdentifiers.hashCode()); result = prime * result + ((workSource == null) ? 0 : workSource.hashCode()); result = prime * result + ((source == null) ? 0 : source.hashCode()); result = prime * result + ((workTitle == null) ? 0 : workTitle.hashCode()); result = prime * result + ((workType == null) ? 0 : workType.hashCode()); result = prime * result + ((journalTitle == null) ? 0 : journalTitle.hashCode()); result = prime * result + ((languageCode == null) ? 0 : languageCode.hashCode()); result = prime * result + ((country == null) ? 0 : country.hashCode()); return result; }
if (other.workCitation != null) return false; } else if (!workCitation.equals(other.workCitation)) return false; if (workContributors == null) {
/** * Create an instance of {@link Citation } * */ public Citation createCitation() { return new Citation(); }
/** * Note that put-code is not part of hashcode. This is important for avoid * creation of duplication works. */ @Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((publicationDate == null) ? 0 : publicationDate.hashCode()); result = prime * result + ((shortDescription == null) ? 0 : shortDescription.hashCode()); result = prime * result + ((url == null) ? 0 : url.hashCode()); result = prime * result + ((visibility == null) ? 0 : visibility.hashCode()); result = prime * result + ((workCitation == null) ? 0 : workCitation.hashCode()); result = prime * result + ((workContributors == null) ? 0 : workContributors.hashCode()); result = prime * result + ((workExternalIdentifiers == null) ? 0 : workExternalIdentifiers.hashCode()); result = prime * result + ((workSource == null) ? 0 : workSource.hashCode()); result = prime * result + ((source == null) ? 0 : source.hashCode()); result = prime * result + ((workTitle == null) ? 0 : workTitle.hashCode()); result = prime * result + ((workType == null) ? 0 : workType.hashCode()); result = prime * result + ((journalTitle == null) ? 0 : journalTitle.hashCode()); result = prime * result + ((languageCode == null) ? 0 : languageCode.hashCode()); result = prime * result + ((country == null) ? 0 : country.hashCode()); return result; }
if (other.workCitation != null) return false; } else if (!workCitation.equals(other.workCitation)) return false; if (workContributors == null) {
private Citation getWorkCitation(WorkEntity work) { if (StringUtils.isNotBlank(work.getCitation()) && work.getCitationType() != null) { return new Citation(work.getCitation(), CitationType.valueOf(work.getCitationType())); } return null; }
@Override public int hashCode() { int result = this.orcidWork.getWorkTitle() != null ? this.orcidWork.getWorkTitle().hashCode() : 0; result = 31 * result + (this.orcidWork.getShortDescription() != null ? this.orcidWork.getShortDescription().hashCode() : 0); result = 31 * result + (this.orcidWork.getWorkCitation() != null ? this.orcidWork.getWorkCitation().hashCode() : 0); result = 31 * result + (this.orcidWork.getWorkType() != null ? this.orcidWork.getWorkType().hashCode() : 0); result = 31 * result + (this.orcidWork.getPublicationDate() != null ? this.orcidWork.getPublicationDate().hashCode() : 0); result = 31 * result + (this.orcidWork.getWorkExternalIdentifiers() != null ? this.orcidWork.getWorkExternalIdentifiers().hashCode() : 0); result = 31 * result + (this.orcidWork.getUrl() != null ? this.orcidWork.getUrl().hashCode() : 0); result = 31 * result + (this.orcidWork.getWorkContributors() != null ? this.orcidWork.getWorkContributors().hashCode() : 0); result = 31 * result + (this.orcidWork.getWorkSource() != null ? this.orcidWork.getWorkSource().hashCode() : 0); return result; }
if (this.orcidWork.getWorkCitation() != null ? !this.orcidWork.getWorkCitation().equals(orcidWork.getWorkCitation()) : orcidWork.getWorkCitation() != null) { return false;
if (workCitation != null && StringUtils.isNotBlank(workCitation.getCitation()) && workCitation.getWorkCitationType() != null) { workEntity.setCitation(workCitation.getCitation()); workEntity.setCitationType(workCitation.getWorkCitationType().name());