/** * Constructs a new instance initialized with the values from the specified metadata object. * This is a <cite>shallow</cite> copy constructor, since the other metadata contained in the * given object are not recursively copied. * * @param object the metadata to copy values from, or {@code null} if none. * * @see #castOrCopy(Address) */ public DefaultAddress(final Address object) { super(object); if (object != null) { deliveryPoints = copyCollection(object.getDeliveryPoints(), String.class); city = object.getCity(); administrativeArea = object.getAdministrativeArea(); postalCode = object.getPostalCode(); country = object.getCountry(); electronicMailAddresses = copyCollection(object.getElectronicMailAddresses(), String.class); } }
assertEquals("Plouzané", address.getCity().toString()); assertEquals("France", address.getCountry().toString()); assertEquals(1, address.getElectronicMailAddresses().size()); final XLink anchor = (XLink) address.getCountry(); assertEquals("France", anchor.toString()); assertEquals("SDN:C320:2:FR", anchor.getHRef().toString());
/** * Returns {@code true} if the given email is null, or if the given address contains that email. * * @param address the value stored in the metadata object. * @param email the value parsed from the netCDF file. */ private static boolean canShare(final Address address, final String email) { return (email == null) || (address != null && canShare(address.getElectronicMailAddresses(), email)); }
/** * Returns {@code true} if the given email is null, or if the given address contains that email. * * @param address the value stored in the metadata object. * @param email the value parsed from the netCDF file. */ private static boolean canShare(final Address address, final String email) { return (email == null) || (address != null && canShare(address.getElectronicMailAddresses(), email)); }
/** * Constructs a new instance initialized with the values from the specified metadata object. * This is a <cite>shallow</cite> copy constructor, since the other metadata contained in the * given object are not recursively copied. * * @param object the metadata to copy values from, or {@code null} if none. * * @see #castOrCopy(Address) */ public DefaultAddress(final Address object) { super(object); if (object != null) { deliveryPoints = copyCollection(object.getDeliveryPoints(), String.class); city = object.getCity(); administrativeArea = object.getAdministrativeArea(); postalCode = object.getPostalCode(); country = object.getCountry(); electronicMailAddresses = copyCollection(object.getElectronicMailAddresses(), String.class); } }
for(String s:r.getContactInfo().getAddress().getElectronicMailAddresses()) { metadata.add("CitedResponsiblePartyEMail ",s.toString());
/** * Validates the given address. * * @param object the object to validate, or {@code null}. * * @since 3.1 */ public void validate(final Address object) { if (object == null) { return; } validate(object.getDeliveryPoints()); validateOptional(object.getCity()); validateOptional(object.getAdministrativeArea()); validateOptional(object.getCountry()); validate(object.getElectronicMailAddresses()); }
contactInfo.getAddress().getElectronicMailAddresses().add((String)node.getChildValue("ContactElectronicMailAddress"));
for(String s:r.getContactInfo().getAddress().getElectronicMailAddresses()) { metadata.add("CitedResponsiblePartyEMail ",s.toString());
for(String s:r.getContactInfo().getAddress().getElectronicMailAddresses()) { metadata.add("CitedResponsiblePartyEMail ",s.toString());