Class ContactAdapter

java.lang.Object
org.gbif.api.util.ContactAdapter

public class ContactAdapter extends Object
Adapt the Dataset Contact list for what metadata documents generally want.
Author:
cgendreau
  • Constructor Details

  • Method Details

    • getAssociatedParties

      Get the list of AssociatedParties. This is defined as all non-primary Contact, excluding contacts with types the following types considered primary types: Originator, MetadataAuthor and AdministrativePointOfContact.
      Returns:
      list of AssociatedParties or empty list if none found
    • getResourceCreator

      Get the ResourceCreator Contact. This is defined as the first primary Contact of type ContactType.ORIGINATOR.
      Returns:
      first preferred ResourceCreator found or null if none were found
    • formatContactName

      public static String formatContactName(Contact contact)
      Format the name of the contact as "FirstName LastName".
      Parameters:
      contact - contact
      Returns:
      formatted name or "" if the contact is null or empty
    • getAdministrativeContact

      Get the AdministrativeContact Contact. This is defined as the first primary Contact of type ContactType.ADMINISTRATIVE_POINT_OF_CONTACT.
      Returns:
      first preferred AdministrativeContact found or null if none were found
    • getFilteredContacts

      Filter contacts based on the provided contact types. The order in which the ContactType are provided will be respected in the response except missing ContactType will be ommited. Filtering is done by the getFirstPreferredType(org.gbif.api.vocabulary.ContactType) method.
      Parameters:
      types - contact types
      Returns:
      filtered contacts or an empty list if none matched
    • getFirstPreferredType

      Get the first primary Contact for the provided type.
      Returns:
      first preferred type contact found or null if nothing were found
    • getCreators

      Get the list of Contact of type ContactType.ORIGINATOR.
      Returns:
      all creators found or empty list if none were found
    • getContacts

      Get the list of Contact of type ContactType.ADMINISTRATIVE_POINT_OF_CONTACT.
      Returns:
      all contacts found or empty list if none were found
    • getMetadataProviders

      Get the list of Contact of type ContactType.METADATA_AUTHOR.
      Returns:
      all metadataProviders found or empty list if none were found
    • getAllType

      Get all Contact for the provided type.
      Returns:
      all Contact for specified type or empty list if none found