Package org.gbif.api.model.registry
Class Contact
- java.lang.Object
-
- org.gbif.api.model.registry.Contact
-
- All Implemented Interfaces:
Serializable
,Address
,LenientEquals<Contact>
public class Contact extends Object implements Address, LenientEquals<Contact>
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description Contact()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addAddress(String address)
void
addEmail(String email)
void
addHomepage(URI homepage)
void
addPhone(String phone)
void
addPosition(String position)
void
addUserId(String userId)
void
addUserId(String directory, String id)
Adds a new user id that is assembled from a directory name and a local id within it.String
computeCompleteName()
Compute and returns the complete name in the form: FirstName LastName.boolean
equals(Object o)
List<String>
getAddress()
deliveryPoint in EMLString
getCity()
city in EMLCountry
getCountry()
country in EML@Null(groups=PrePersist.class) @NotNull(groups=PostPersist.class) Date
getCreated()
@Size(min=3) String
getCreatedBy()
String
getDescription()
List<String>
getEmail()
electronicMailAddress in EML@Size(min=1) String
getFirstName()
List<URI>
getHomepage()
List of homepage websites.@Null(groups=PrePersist.class) @NotNull(groups=PostPersist.class) Integer
getKey()
@Size(min=1) String
getLastName()
@Null(groups=PrePersist.class) @NotNull(groups=PostPersist.class) Date
getModified()
@Size(min=3) String
getModifiedBy()
@Size(min=2) String
getOrganization()
Institution name as part of the addressList<String>
getPhone()
phone in EMLList<String>
getPosition()
String
getPostalCode()
postalCode in EMLString
getProvince()
administrativeArea in EMLString
getSalutation()
ContactType
getType()
List<String>
getUserId()
int
hashCode()
boolean
isPrimary()
boolean
lenientEquals(Contact contact)
This implementation of theequals(Object)
method does only check business equality and disregards automatically set and maintained fields likecreatedBy, key
and others.void
setAddress(List<String> address)
void
setCity(String city)
void
setCountry(Country country)
void
setCreated(Date created)
void
setCreatedBy(String createdBy)
void
setDescription(String description)
void
setEmail(List<String> email)
void
setFirstName(String firstName)
void
setHomepage(List<URI> homepage)
void
setKey(Integer key)
void
setLastName(String lastName)
void
setModified(Date modified)
void
setModifiedBy(String modifiedBy)
void
setOrganization(String organization)
void
setPhone(List<String> phone)
void
setPosition(List<String> position)
void
setPostalCode(String postalCode)
void
setPrimary(boolean primary)
void
setProvince(String province)
void
setSalutation(String salutation)
void
setType(ContactType type)
void
setUserId(List<String> userId)
String
toString()
-
-
-
Constructor Detail
-
Contact
public Contact()
-
-
Method Detail
-
getKey
@Null(groups=PrePersist.class) @NotNull(groups=PostPersist.class) public @Null(groups=PrePersist.class) @NotNull(groups=PostPersist.class) Integer getKey()
-
getType
@Nullable public ContactType getType()
-
setType
public void setType(ContactType type)
-
isPrimary
public boolean isPrimary()
-
setPrimary
public void setPrimary(boolean primary)
-
addUserId
public void addUserId(String directory, String id)
Adds a new user id that is assembled from a directory name and a local id within it. Format used by EML, though see https://github.com/gbif/gbif-api/issues/30. The directory should be a valid URI, if it's not, it will be ignored by this method.- Parameters:
directory
- identifier for the directory, preferably a URL domain like http://orcid.orgid
- the identifier in that directory
-
getSalutation
@Nullable public String getSalutation()
-
setSalutation
public void setSalutation(String salutation)
-
getFirstName
@Nullable @Size(min=1) public @Size(min=1) String getFirstName()
-
setFirstName
public void setFirstName(String firstName)
-
getLastName
@Nullable @Size(min=1) public @Size(min=1) String getLastName()
-
setLastName
public void setLastName(String lastName)
-
computeCompleteName
public String computeCompleteName()
Compute and returns the complete name in the form: FirstName LastName. Since all parts are optional, this method can return an empty string (but never null)- Returns:
- the non-empty parts of FirstName LastName or empty string if none
-
getPosition
public List<String> getPosition()
-
setPosition
public void setPosition(List<String> position)
-
addPosition
public void addPosition(String position)
-
getDescription
@Nullable public String getDescription()
-
setDescription
public void setDescription(String description)
-
getEmail
public List<String> getEmail()
Description copied from interface:Address
electronicMailAddress in EML
-
getAddress
public List<String> getAddress()
Description copied from interface:Address
deliveryPoint in EML- Specified by:
getAddress
in interfaceAddress
-
setAddress
public void setAddress(List<String> address)
- Specified by:
setAddress
in interfaceAddress
-
addAddress
public void addAddress(String address)
-
getProvince
public String getProvince()
Description copied from interface:Address
administrativeArea in EML- Specified by:
getProvince
in interfaceAddress
-
setProvince
public void setProvince(String province)
- Specified by:
setProvince
in interfaceAddress
-
getCountry
public Country getCountry()
Description copied from interface:Address
country in EML- Specified by:
getCountry
in interfaceAddress
-
setCountry
public void setCountry(Country country)
- Specified by:
setCountry
in interfaceAddress
-
getPostalCode
public String getPostalCode()
Description copied from interface:Address
postalCode in EML- Specified by:
getPostalCode
in interfaceAddress
-
setPostalCode
public void setPostalCode(String postalCode)
- Specified by:
setPostalCode
in interfaceAddress
-
getOrganization
@Nullable @Size(min=2) public @Size(min=2) String getOrganization()
Description copied from interface:Address
Institution name as part of the address- Specified by:
getOrganization
in interfaceAddress
-
setOrganization
public void setOrganization(String organization)
- Specified by:
setOrganization
in interfaceAddress
-
getHomepage
public List<URI> getHomepage()
Description copied from interface:Address
List of homepage websites.- Specified by:
getHomepage
in interfaceAddress
-
setHomepage
public void setHomepage(List<URI> homepage)
- Specified by:
setHomepage
in interfaceAddress
-
addHomepage
public void addHomepage(URI homepage)
-
getCreatedBy
@Size(min=3) public @Size(min=3) String getCreatedBy()
-
setCreatedBy
public void setCreatedBy(String createdBy)
-
getModifiedBy
@Size(min=3) public @Size(min=3) String getModifiedBy()
-
setModifiedBy
public void setModifiedBy(String modifiedBy)
-
getCreated
@Null(groups=PrePersist.class) @NotNull(groups=PostPersist.class) public @Null(groups=PrePersist.class) @NotNull(groups=PostPersist.class) Date getCreated()
-
setCreated
public void setCreated(Date created)
-
getModified
@Null(groups=PrePersist.class) @NotNull(groups=PostPersist.class) public @Null(groups=PrePersist.class) @NotNull(groups=PostPersist.class) Date getModified()
-
setModified
public void setModified(Date modified)
-
lenientEquals
public boolean lenientEquals(Contact contact)
This implementation of theequals(Object)
method does only check business equality and disregards automatically set and maintained fields likecreatedBy, key
and others.- Specified by:
lenientEquals
in interfaceLenientEquals<Contact>
- Parameters:
contact
- To compare against- Returns:
- true if...
-
-