Package adams.core.net
Class EmailContact
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.core.option.AbstractOptionHandler
-
- adams.core.net.EmailContact
-
- All Implemented Interfaces:
Destroyable
,GlobalInfoSupporter
,LoggingLevelHandler
,LoggingSupporter
,OptionHandler
,ShallowCopySupporter<EmailContact>
,SizeOfHandler
,Serializable
,Comparable<EmailContact>
public class EmailContact extends AbstractOptionHandler implements Comparable<EmailContact>, ShallowCopySupporter<EmailContact>
Encapsulates an email contact.- Version:
- $Revision$
- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected String
m_Address
the address.protected String
m_Email
the email address.protected String
m_FirstName
the first name.protected String
m_LastName
the last name.protected String
m_Note
the note.protected String
m_Phone
the phone.-
Fields inherited from class adams.core.option.AbstractOptionHandler
m_OptionManager
-
Fields inherited from class adams.core.logging.LoggingObject
m_Logger, m_LoggingIsEnabled, m_LoggingLevel
-
-
Constructor Summary
Constructors Constructor Description EmailContact()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
addressTipText()
Returns the tip text for this property.int
compareTo(EmailContact o)
Compares this contact with the provided one.void
defineOptions()
Adds options to the internal list of options.String
emailTipText()
Returns the tip text for this property.boolean
equals(Object obj)
Compares this object against the specified one.String
firstNameTipText()
Returns the tip text for this property.String
getAddress()
Returns the address.String
getEmail()
Returns the email name.String
getFirstName()
Returns the first name.String
getLastName()
Returns the last name.String
getNote()
Returns the note.String
getPhone()
Returns the phone.String
globalInfo()
Returns a string describing the object.String
lastNameTipText()
Returns the tip text for this property.String
noteTipText()
Returns the tip text for this property.String
phoneTipText()
Returns the tip text for this property.void
setAddress(String value)
Sets the address.void
setEmail(String value)
Sets the email.void
setFirstName(String value)
Sets the first name.void
setLastName(String value)
Sets the last name.void
setNote(String value)
Sets the note.void
setPhone(String value)
Sets the phone.EmailContact
shallowCopy()
Returns a shallow copy of itself, i.e., based on the commandline options.EmailContact
shallowCopy(boolean expand)
Returns a shallow copy of itself, i.e., based on the commandline options.EmailAddress
toEmailAddress()
Turns the contact into an email address.-
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, destroy, finishInit, getDefaultLoggingLevel, getOptionManager, initialize, loggingLevelTipText, newOptionManager, reset, setLoggingLevel, toCommandLine, toString
-
Methods inherited from class adams.core.logging.LoggingObject
configureLogger, getLogger, getLoggingLevel, initializeLogging, isLoggingEnabled, sizeOf
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface adams.core.logging.LoggingLevelHandler
getLoggingLevel
-
-
-
-
Field Detail
-
m_FirstName
protected String m_FirstName
the first name.
-
m_LastName
protected String m_LastName
the last name.
-
m_Email
protected String m_Email
the email address.
-
m_Address
protected String m_Address
the address.
-
m_Phone
protected String m_Phone
the phone.
-
m_Note
protected String m_Note
the note.
-
-
Method Detail
-
globalInfo
public String globalInfo()
Returns a string describing the object.- Specified by:
globalInfo
in interfaceGlobalInfoSupporter
- Specified by:
globalInfo
in classAbstractOptionHandler
- Returns:
- a description suitable for displaying in the gui
-
defineOptions
public void defineOptions()
Adds options to the internal list of options.- Specified by:
defineOptions
in interfaceOptionHandler
- Overrides:
defineOptions
in classAbstractOptionHandler
-
setFirstName
public void setFirstName(String value)
Sets the first name.- Parameters:
value
- the first name
-
getFirstName
public String getFirstName()
Returns the first name.- Returns:
- the first name
-
firstNameTipText
public String firstNameTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setLastName
public void setLastName(String value)
Sets the last name.- Parameters:
value
- the last name
-
getLastName
public String getLastName()
Returns the last name.- Returns:
- the last name
-
lastNameTipText
public String lastNameTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setEmail
public void setEmail(String value)
Sets the email.- Parameters:
value
- the email
-
getEmail
public String getEmail()
Returns the email name.- Returns:
- the email
-
emailTipText
public String emailTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setPhone
public void setPhone(String value)
Sets the phone.- Parameters:
value
- the phone
-
getPhone
public String getPhone()
Returns the phone.- Returns:
- the phone
-
phoneTipText
public String phoneTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setAddress
public void setAddress(String value)
Sets the address.- Parameters:
value
- the address
-
getAddress
public String getAddress()
Returns the address.- Returns:
- the address
-
addressTipText
public String addressTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setNote
public void setNote(String value)
Sets the note.- Parameters:
value
- the note
-
getNote
public String getNote()
Returns the note.- Returns:
- the note
-
noteTipText
public String noteTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
compareTo
public int compareTo(EmailContact o)
Compares this contact with the provided one.- Specified by:
compareTo
in interfaceComparable<EmailContact>
- Parameters:
o
- the contact to compare with- Returns:
- -1 if less than, 0 if equals, +1 if greater than the provided contact
-
equals
public boolean equals(Object obj)
Compares this object against the specified one.
-
shallowCopy
public EmailContact shallowCopy()
Returns a shallow copy of itself, i.e., based on the commandline options.- Specified by:
shallowCopy
in interfaceShallowCopySupporter<EmailContact>
- Returns:
- the shallow copy
-
shallowCopy
public EmailContact shallowCopy(boolean expand)
Returns a shallow copy of itself, i.e., based on the commandline options.- Specified by:
shallowCopy
in interfaceShallowCopySupporter<EmailContact>
- Parameters:
expand
- whether to expand variables to their current values- Returns:
- the shallow copy
-
toEmailAddress
public EmailAddress toEmailAddress()
Turns the contact into an email address.- Returns:
- the generated email address
-
-