@Generated(value = "com.sun.tools.xjc.Driver", date = "2018-04-24T11:17:38-05:00", comments = "JAXB RI v2.2.11") public String toString() { final ToStringStrategy strategy = JAXBToStringStrategy.INSTANCE; final StringBuilder buffer = new StringBuilder(); append(null, buffer, strategy); return buffer.toString(); }
/** * Create an instance of {@link Url } * */ public Url createUrl() { return new Url(); }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; ResearcherUrl other = (ResearcherUrl) obj; if (path == null) { if (other.path != null) return false; } else if (!path.equals(other.path)) return false; if (url == null) { if (other.url != null) return false; } else if (!url.equals(other.url)) return false; if (urlName == null) { if (other.urlName != null) return false; } else if (!urlName.equals(other.urlName)) return false; if (visibility != other.visibility) return false; return true; }
@Generated(value = "com.sun.tools.xjc.Driver", date = "2018-04-24T11:17:38-05:00", comments = "JAXB RI v2.2.11") public StringBuilder append(ObjectLocator locator, StringBuilder buffer, ToStringStrategy strategy) { strategy.appendStart(locator, this, buffer); appendFields(locator, buffer, strategy); strategy.appendEnd(locator, this, buffer); return buffer; }
@Override public int compareTo(ResearcherUrl o) { if(o == null || o.getUrlName() == null) { return 1; } if(getUrlName() == null) { return -1; } int urlNameComp = this.getUrlName().compareTo(o.getUrlName()); if(urlNameComp == 0) { if(o.getUrl() == null) { return 1; } if(this.getUrl() == null) { return -1; } return this.getUrl().compareTo(o.getUrl()); } return 0; } }
@Override public ExternalIDs convertFrom(String source, Type<ExternalIDs> destinationType) { JSONFundingExternalIdentifiers fundingExternalIdentifiers = JsonUtils.readObjectFromJsonString(source, JSONFundingExternalIdentifiers.class); ExternalIDs externalIDs = new ExternalIDs(); for (JSONExternalIdentifier externalIdentifier : fundingExternalIdentifiers.getFundingExternalIdentifier()) { ExternalID id = new ExternalID(); if (externalIdentifier.getType() == null) { id.setType(FundingExternalIdentifierType.GRANT_NUMBER.value()); } else { id.setType(externalIdentifier.getType().toLowerCase()); } if (externalIdentifier.getUrl() != null && !PojoUtil.isEmpty(externalIdentifier.getUrl().getValue())) { Url url = new Url(externalIdentifier.getUrl().getValue()); id.setUrl(url); } if (!PojoUtil.isEmpty(externalIdentifier.getValue())) { id.setValue(externalIdentifier.getValue()); } if (externalIdentifier.getRelationship() != null) { id.setRelationship(Relationship.fromValue(conv.convertFrom(externalIdentifier.getRelationship(), null))); } externalIDs.getExternalIdentifier().add(id); } return externalIDs; }
if (other.url != null) return false; } else if (!url.equals(other.url)) return false; return true;
@Override public ExternalIDs convertFrom(String source, Type<ExternalIDs> destinationType) { JSONWorkExternalIdentifiers workExternalIdentifiers = JsonUtils.readObjectFromJsonString(source, JSONWorkExternalIdentifiers.class); ExternalIDs externalIDs = new ExternalIDs(); for (JSONWorkExternalIdentifier workExternalIdentifier : workExternalIdentifiers.getWorkExternalIdentifier()) { if(workExternalIdentifier.getRelationship() == null || !org.orcid.jaxb.model.common.Relationship.VERSION_OF.name().equals(workExternalIdentifier.getRelationship())) { ExternalID id = new ExternalID(); if (workExternalIdentifier.getWorkExternalIdentifierType() == null) { id.setType(WorkExternalIdentifierType.OTHER_ID.value()); } else { id.setType(conv.convertFrom(workExternalIdentifier.getWorkExternalIdentifierType(), null)); } if (workExternalIdentifier.getWorkExternalIdentifierId() != null) { id.setValue(workExternalIdentifier.getWorkExternalIdentifierId().content); } if (workExternalIdentifier.getUrl() != null) { id.setUrl(new Url(workExternalIdentifier.getUrl().getValue())); } if (workExternalIdentifier.getRelationship() != null) { id.setRelationship(Relationship.fromValue(conv.convertFrom(workExternalIdentifier.getRelationship(), null))); } externalIDs.getExternalIdentifier().add(id); } } return externalIDs; }
if (other.url != null) return false; } else if (!url.equals(other.url)) return false; if (visibility != other.visibility)
@Generated(value = "com.sun.tools.xjc.Driver", date = "2018-04-24T11:17:38-05:00", comments = "JAXB RI v2.2.11") public StringBuilder appendFields(ObjectLocator locator, StringBuilder buffer, ToStringStrategy strategy) { { String theValue; theValue = this.getValue(); strategy.appendField(locator, this, "value", buffer, theValue); } return buffer; }
@Override public ExternalID convertFrom(String source, Type<ExternalID> destinationType) { JSONWorkExternalIdentifier workExternalIdentifier = JsonUtils.readObjectFromJsonString(source, JSONWorkExternalIdentifier.class); ExternalID id = new ExternalID(); if (workExternalIdentifier.getWorkExternalIdentifierType() == null) { id.setType(WorkExternalIdentifierType.OTHER_ID.value()); } else { id.setType(conv.convertFrom(workExternalIdentifier.getWorkExternalIdentifierType(), null)); } if (workExternalIdentifier.getWorkExternalIdentifierId() != null) { id.setValue(workExternalIdentifier.getWorkExternalIdentifierId().content); } if (workExternalIdentifier.getUrl() != null) { id.setUrl(new Url(workExternalIdentifier.getUrl().getValue())); } if (workExternalIdentifier.getRelationship() != null) { id.setRelationship(Relationship.fromValue(conv.convertFrom(workExternalIdentifier.getRelationship(), null))); } return id; }
if (other.url != null) return false; } else if (!url.equals(other.url)) return false; if (visibility != other.visibility)
private boolean isDuplicated(ResearcherUrlEntity existing, ResearcherUrl newResearcherUrl, SourceEntity source) { if (!existing.getId().equals(newResearcherUrl.getPutCode())) { //If they have the same source String existingSourceId = existing.getElementSourceId(); // If they have the same source if (!PojoUtil.isEmpty(existingSourceId) && existingSourceId.equals(SourceEntityUtils.getSourceId(source))) { // If the url is the same if (existing.getUrl() != null && existing.getUrl().equals(newResearcherUrl.getUrl().getValue())) { return true; } } } return false; }
return; if(PojoUtil.isEmpty(researcherUrl.getUrl().getValue())) { String message = "Url field must not be empty"; LOGGER.error(message); throw new OrcidValidationException(message); } else { if(SiteConstants.URL_MAX_LENGTH < researcherUrl.getUrl().getValue().length()) { String message = "Url field must not be longer than " + SiteConstants.URL_MAX_LENGTH + " characters"; LOGGER.error(message);
return false; } else { if (!url.equals(other.url)) return false;
throw new OrcidValidationException(message); } else { if(SiteConstants.URL_MAX_LENGTH < externalIdentifier.getUrl().getValue().length()) { String message = "Url must not be longer than " + SiteConstants.URL_MAX_LENGTH + " characters"; LOGGER.error(message);