eu.etaxonomy.cdm.model.agent
Class Contact

java.lang.Object
  extended by eu.etaxonomy.cdm.model.agent.Contact
All Implemented Interfaces:
Serializable, Cloneable

public class Contact
extends Object
implements Serializable, Cloneable

The class for information on how to approach a person or an institution. It includes telecommunication data and an electronic as well as multiple postal addresses.

This class corresponds to:

Version:
1.0
Author:
m.doering
See Also:
Serialized Form

Field Summary
protected  Set<Address> addresses
           
 
Constructor Summary
Contact()
          Class constructor.
 
Method Summary
 void addAddress(Address address)
          Adds a new postal address to the set of postal addresses of this contact.
 void addAddress(String street, String postcode, String locality, WaterbodyOrCountry country, String pobox, String region, Point location)
           
 void addEmailAddress(String emailAddress)
           
 void addFaxNumber(String faxNumber)
           
 void addPhoneNumber(String phoneNumber)
           
 void addUrl(String url)
           
 Object clone()
          Clones this Contact.
 Set<Address> getAddresses()
          Returns the set of postal addresses belonging to this contact.
 List<String> getEmailAddresses()
          Returns the List of strings representing the electronic mail addresses included in this contact.
 List<String> getFaxNumbers()
          Returns the list of strings representing the telefax numbers included in this contact.
 List<String> getPhoneNumbers()
          Returns the list of strings representing the phone numbers included in this contact.
 List<String> getUrls()
          Returns the list of strings representing the "Uniform Resource Locators" (urls) included in this contact.
 void merge(Contact contact2)
           
static Contact NewInstance()
           
static Contact NewInstance(Set<Address> addresses, List<String> emailAdresses, List<String> faxNumbers, List<String> phoneNumbers, List<String> urls)
           
static Contact NewInstance(String street, String postcode, String locality, WaterbodyOrCountry country, String pobox, String region, String email, String faxNumber, String phoneNumber, String url, Point location)
          Creates a new contact
 void removeAddress(Address address)
          Removes one element from the set of postal addresses of this contact.
 void removeEmailAddress(String emailAddress)
          Removes one element from the list of email addresses of this contact.
 void removeFaxNumber(String faxNumber)
          Removes one element from the list of telefax numbers of this contact.
 void removePhoneNumber(String phoneNumber)
          Removes one element from the list of phone numbers of this contact.
 void removeUrl(String url)
          Removes one element from the list of urls of this contact.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

addresses

protected Set<Address> addresses
Constructor Detail

Contact

public Contact()
Class constructor.

Method Detail

NewInstance

public static Contact NewInstance()

NewInstance

public static Contact NewInstance(String street,
                                  String postcode,
                                  String locality,
                                  WaterbodyOrCountry country,
                                  String pobox,
                                  String region,
                                  String email,
                                  String faxNumber,
                                  String phoneNumber,
                                  String url,
                                  Point location)
Creates a new contact

Parameters:
street -
postcode -
locality -
country -
pobox -
region -
email -
faxNumber -
phoneNumber -
url -
location -
Returns:

NewInstance

public static Contact NewInstance(Set<Address> addresses,
                                  List<String> emailAdresses,
                                  List<String> faxNumbers,
                                  List<String> phoneNumbers,
                                  List<String> urls)

merge

public void merge(Contact contact2)
           throws MergeException
Throws:
MergeException

getAddresses

public Set<Address> getAddresses()
Returns the set of postal addresses belonging to this contact. A person or an institution cannot have more than one contact, but a contact may include several postal addresses.

Returns:
the set of postal addresses
See Also:
Address

addAddress

public void addAddress(Address address)
Adds a new postal address to the set of postal addresses of this contact.

Parameters:
address - the address to be added
See Also:
getAddresses(), Address

addAddress

public void addAddress(String street,
                       String postcode,
                       String locality,
                       WaterbodyOrCountry country,
                       String pobox,
                       String region,
                       Point location)

removeAddress

public void removeAddress(Address address)
Removes one element from the set of postal addresses of this contact.

Parameters:
address - the postal address of this contact which should be deleted
See Also:
getAddresses()

getEmailAddresses

public List<String> getEmailAddresses()
Returns the List of strings representing the electronic mail addresses included in this contact.


addEmailAddress

public void addEmailAddress(String emailAddress)
See Also:
#getEmailAddress()

removeEmailAddress

public void removeEmailAddress(String emailAddress)
Removes one element from the list of email addresses of this contact.

Parameters:
emailAddress - the email address of this contact which should be deleted
See Also:
getEmailAddresses()

getUrls

public List<String> getUrls()
Returns the list of strings representing the "Uniform Resource Locators" (urls) included in this contact.


addUrl

public void addUrl(String url)
See Also:
getUrls()

removeUrl

public void removeUrl(String url)
Removes one element from the list of urls of this contact.

Parameters:
url - the url of this contact which should be deleted
See Also:
getUrls()

getPhoneNumbers

public List<String> getPhoneNumbers()
Returns the list of strings representing the phone numbers included in this contact.


addPhoneNumber

public void addPhoneNumber(String phoneNumber)
See Also:
#getPhone()

removePhoneNumber

public void removePhoneNumber(String phoneNumber)
Removes one element from the list of phone numbers of this contact.

Parameters:
phoneNumber - the phone number of this contact which should be deleted
See Also:
#getPhoneNumber()

getFaxNumbers

public List<String> getFaxNumbers()
Returns the list of strings representing the telefax numbers included in this contact.


addFaxNumber

public void addFaxNumber(String faxNumber)
See Also:
getFaxNumbers()

removeFaxNumber

public void removeFaxNumber(String faxNumber)
Removes one element from the list of telefax numbers of this contact.

Parameters:
faxNumber - the telefax number of this contact which should be deleted
See Also:
#getFaxNumber()

clone

public Object clone()
Clones this Contact. This is a shortcut that enables to create a new instance that differs only slightly from this Contact.

Overrides:
clone in class Object
See Also:
Object.clone()


Copyright © 2007-2012 EDIT. All Rights Reserved.