@XmlElement(name = "address") private Collection<Address> getAddressList() { return FilterByVersion.CURRENT_METADATA.accept() ? getAddresses() : null; }
/** * Returns the physical and email address at which the organization or individual may be contacted. * This method returns the first {@link #getAddresses() adress} element, or null if none. * * @return physical and email address at which the organization or individual may be contacted, or {@code null}. * * @deprecated As of ISO 19115:2014, replaced by {@link #getAddresses()}. */ @Override @Deprecated @XmlElement(name = "address") @Dependencies("getAddresses") public Address getAddress() { return LegacyPropertyAdapter.getSingleton(getAddresses(), Address.class, null, DefaultContact.class, "getAddress"); }
/** * Returns the physical and email address at which the organization or individual may be contacted. * This method returns the first {@link #getAddresses() adress} element, or null if none. * * @return physical and email address at which the organization or individual may be contacted, or {@code null}. * * @deprecated As of ISO 19115:2014, replaced by {@link #getAddresses()}. */ @Override @Deprecated @Dependencies("getAddresses") @XmlElement(name = "address", namespace = LegacyNamespaces.GMD) public Address getAddress() { if (FilterByVersion.LEGACY_METADATA.accept()) { return LegacyPropertyAdapter.getSingleton(getAddresses(), Address.class, null, DefaultContact.class, "getAddress"); } return null; // Marshalling newer ISO 19115-3 }
/** * 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(Contact) */ public DefaultContact(final Contact object) { super(object); if (object != null) { hoursOfService = object.getHoursOfService(); contactInstructions = object.getContactInstructions(); if (object instanceof DefaultContact) { final DefaultContact c = (DefaultContact) object; phones = copyCollection(c.getPhones(), Telephone.class); addresses = copyCollection(c.getAddresses(), Address.class); onlineResources = copyCollection(c.getOnlineResources(), OnlineResource.class); contactType = c.getContactType(); } else { phones = singleton(object.getPhone(), Telephone.class); addresses = singleton(object.getAddress(), Address.class); onlineResources = singleton(object.getOnlineResource(), OnlineResource.class); } } }
/** * 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(Contact) */ public DefaultContact(final Contact object) { super(object); if (object != null) { hoursOfService = object.getHoursOfService(); contactInstructions = object.getContactInstructions(); if (object instanceof DefaultContact) { final DefaultContact c = (DefaultContact) object; phones = copyCollection(c.getPhones(), Telephone.class); addresses = copyCollection(c.getAddresses(), Address.class); onlineResources = copyCollection(c.getOnlineResources(), OnlineResource.class); contactType = c.getContactType(); } else { phones = singleton(object.getPhone(), Telephone.class); addresses = singleton(object.getAddress(), Address.class); onlineResources = singleton(object.getOnlineResource(), OnlineResource.class); } } }