/** * Sets the address of the responsible party. * * <p>This implementation sets the contact info in the first party found in the collection of * {@linkplain #getParties() parties}.</p> * * @param newValue the new contact info, or {@code null} if none. * * @deprecated As of ISO 19115:2014, replaced by {@link AbstractParty#setContactInfo(Collection)}. */ @Deprecated public void setContactInfo(final Contact newValue) { checkWritePermission(); final Iterator<AbstractParty> it = getParties().iterator(); while (it.hasNext()) { final AbstractParty party = it.next(); party.setContactInfo(newValue != null ? Collections.singleton(newValue) : null); if (party.isEmpty()) { it.remove(); } return; } /* * If no existing AbstractParty were found, add a new one. However there is no way to know if * it should be an individual or an organization. Arbitrarily choose an individual for now. */ if (newValue != null) { getParties().add(new DefaultIndividual(null, null, newValue)); } }
/** * Sets the address of the responsible party. * * <p>This implementation sets the contact info in the first party found in the collection of * {@linkplain #getParties() parties}.</p> * * @param newValue the new contact info, or {@code null} if none. * * @deprecated As of ISO 19115:2014, replaced by {@link AbstractParty#setContactInfo(Collection)}. */ @Deprecated public void setContactInfo(final Contact newValue) { checkWritePermission(valueIfDefined(super.getParties())); final Iterator<AbstractParty> it = getParties().iterator(); while (it.hasNext()) { final AbstractParty party = it.next(); party.setContactInfo(newValue != null ? Collections.singleton(newValue) : null); if (party.isEmpty()) { it.remove(); } return; } /* * If no existing AbstractParty were found, add a new one. However there is no way to know if * it should be an individual or an organization. Arbitrarily choose an individual for now. */ if (newValue != null) { getParties().add(new DefaultIndividual(null, null, newValue)); } }
if (organisationName != null) party = new DefaultOrganisation(organisationName, null, (DefaultIndividual) party, null); if (party == null) party = isOrganisation(keys) ? new DefaultOrganisation() : new DefaultIndividual(); if (contact != null) party.setContactInfo(singleton(contact)); responsibility = new DefaultResponsibleParty(role); ((DefaultResponsibleParty) responsibility).setParties(singleton(party));
if (organisationName != null) party = new DefaultOrganisation(organisationName, null, (DefaultIndividual) party, null); if (party == null) party = isOrganisation(keys) ? new DefaultOrganisation() : new DefaultIndividual(); if (contact != null) party.setContactInfo(singleton(contact)); responsibility = new DefaultResponsibleParty(role); ((DefaultResponsibleParty) responsibility).setParties(singleton(party));