Package org.gbif.api.util
Class ContactAdapter
java.lang.Object
org.gbif.api.util.ContactAdapter
- Author:
- cgendreau
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringformatContactName(Contact contact) Format the name of the contact as "FirstName LastName".Get the AdministrativeContactContact.getAllType(ContactType type) Get allContactfor the provided type.Get the list of AssociatedParties.Get the list ofContactof type ContactType.ADMINISTRATIVE_POINT_OF_CONTACT.Get the list ofContactof type ContactType.ORIGINATOR.getFilteredContacts(ContactType... types) Filter contacts based on the provided contact types.Get the first primaryContactfor the provided type.Get the list ofContactof type ContactType.METADATA_AUTHOR.Get the ResourceCreatorContact.
-
Constructor Details
-
ContactAdapter
-
-
Method Details
-
getAssociatedParties
Get the list of AssociatedParties. This is defined as all non-primaryContact, 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 ResourceCreatorContact. This is defined as the first primaryContactof type ContactType.ORIGINATOR.- Returns:
- first preferred ResourceCreator found or null if none were found
-
formatContactName
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 AdministrativeContactContact. This is defined as the first primaryContactof 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 thegetFirstPreferredType(org.gbif.api.vocabulary.ContactType)method.- Parameters:
types- contact types- Returns:
- filtered contacts or an empty list if none matched
-
getFirstPreferredType
Get the first primaryContactfor the provided type.- Returns:
- first preferred type contact found or null if nothing were found
-
getCreators
Get the list ofContactof type ContactType.ORIGINATOR.- Returns:
- all creators found or empty list if none were found
-
getContacts
Get the list ofContactof type ContactType.ADMINISTRATIVE_POINT_OF_CONTACT.- Returns:
- all contacts found or empty list if none were found
-
getMetadataProviders
Get the list ofContactof type ContactType.METADATA_AUTHOR.- Returns:
- all metadataProviders found or empty list if none were found
-
getAllType
Get allContactfor the provided type.- Returns:
- all
Contactfor specified type or empty list if none found
-