@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; }
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; }
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);