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 String
formatContactName
(Contact contact) Format the name of the contact as "FirstName LastName".Get the AdministrativeContactContact
.getAllType
(ContactType type) Get allContact
for the provided type.Get the list of AssociatedParties.Get the list ofContact
of type ContactType.ADMINISTRATIVE_POINT_OF_CONTACT.Get the list ofContact
of type ContactType.ORIGINATOR.getFilteredContacts
(ContactType... types) Filter contacts based on the provided contact types.Get the first primaryContact
for the provided type.Get the list ofContact
of 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 primaryContact
of 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 primaryContact
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 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 primaryContact
for the provided type.- Returns:
- first preferred type contact found or null if nothing were found
-
getCreators
Get the list ofContact
of type ContactType.ORIGINATOR.- Returns:
- all creators found or empty list if none were found
-
getContacts
Get the list ofContact
of type ContactType.ADMINISTRATIVE_POINT_OF_CONTACT.- Returns:
- all contacts found or empty list if none were found
-
getMetadataProviders
Get the list ofContact
of type ContactType.METADATA_AUTHOR.- Returns:
- all metadataProviders found or empty list if none were found
-
getAllType
Get allContact
for the provided type.- Returns:
- all
Contact
for specified type or empty list if none found
-