/** * Create an instance of {@link Country } * */ public Country createCountry() { return new Country(); }
@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(); }
@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); } { Visibility theVisibility; theVisibility = this.getVisibility(); strategy.appendField(locator, this, "visibility", buffer, theVisibility); } return buffer; }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; Address other = (Address) obj; if (city == null) { if (other.city != null) return false; } else if (!city.equals(other.city)) return false; if (country == null) { if (other.country != null) return false; } else if (!country.equals(other.country)) return false; if (region == null) { if (other.region != null) return false; } else if (!region.equals(other.region)) 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(Address o) { if(o == null || o.getCountry() == null) { return 1; } if(getCountry() == null) { return -1; } return this.getCountry().compareTo(o.getCountry()); } }
if (other.country != null) return false; } else if (!country.equals(other.country)) return false; if (createdDate == null) {
private boolean isDuplicated(AddressEntity existing, Address address, SourceEntity source) { if (!existing.getId().equals(address.getPutCode())) { //If they have the same source String existingSourceId = existing.getElementSourceId(); if (!PojoUtil.isEmpty(existingSourceId) && existingSourceId.equals(SourceEntityUtils.getSourceId(source))) { if(existing.getIso2Country().equals(address.getCountry().getValue())) { return true; } } } return false; }
if (other.country != null) return false; } else if (!country.equals(other.country)) return false;
public static void validateAddress(Address address, SourceEntity sourceEntity, boolean createFlag, boolean isApiRequest, Visibility originalVisibility) { if(createFlag) { if(address.getPutCode() != null) { Map<String, String> params = new HashMap<String, String>(); if (sourceEntity != null) { params.put("clientName", SourceEntityUtils.getSourceName(sourceEntity)); } throw new InvalidPutCodeException(params); } } else { if(address.getPutCode() == null) { Map<String, String> params = new HashMap<String, String>(); throw new PutCodeRequiredException(params); } } if(address.getCountry() == null || address.getCountry().getValue() == null) { String message = "Country cannot be null"; LOGGER.error(message); throw new OrcidValidationException(message); } //Check that we are not changing the visibility validateAndFixVisibility(address, createFlag, isApiRequest, originalVisibility); }
Map<String, String> params = new HashMap<String, String>(); params.put("type", "address"); params.put("value", address.getCountry().getValue().value()); throw new OrcidDuplicatedElementException(params);
if (work.getCountry().getValue() == null) { Map<String, String> params = new HashMap<String, String>(); String values = Arrays.stream(Iso3166Country.values()).map(element -> element.value()).collect(Collectors.joining(", "));
Map<String, String> params = new HashMap<String, String>(); params.put("type", "address"); params.put("value", address.getCountry().getValue().value()); throw new OrcidDuplicatedElementException(params);
if (addr != null) { if (addr.getCountry() != null) { String countryCode = addr.getCountry().getValue().name();
existingAddress.setLastModified(new Date()); existingAddress.setVisibility(updatedOrNew.getVisibility().name()); existingAddress.setIso2Country(updatedOrNew.getCountry().getValue().name()); existingAddress.setDisplayIndex(updatedOrNew.getDisplayIndex()); addressDao.merge(existingAddress);