|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectadams.core.net.EmailAddressBook
public class EmailAddressBook
Helper class for email addresses.
| Field Summary | |
|---|---|
static String |
FILENAME
the properties filename. |
protected Properties |
m_Properties
the underlying properties. |
protected static EmailAddressBook |
m_Singleton
the singleton. |
| Constructor Summary | |
|---|---|
EmailAddressBook()
|
|
| Method Summary | |
|---|---|
Object |
addContact(EmailContact value)
Adds the contact to the properties. |
static String |
createKey(EmailContact value)
Generates a property key for the contact. |
static EmailContact |
fromString(String s)
Turns the string obtained from the properties file into an object. |
EmailContact |
getContact(EmailAddress address)
Returns the contact associated with the email address, null if not found. |
EmailContact |
getContact(EmailAddress address,
EmailContact defValue)
Returns the contact associated with the given email address, the default value if not found. |
List<EmailContact> |
getContacts()
Returns all stored contacts. |
Properties |
getProperties()
Returns the properties, loads them if necessary. |
static EmailAddressBook |
getSingleton()
Returns the singleton. |
boolean |
save()
Saves the properties. |
static String |
toString(EmailContact value)
Turns the object into a string to be stored in the properties file. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String FILENAME
protected static EmailAddressBook m_Singleton
protected Properties m_Properties
| Constructor Detail |
|---|
public EmailAddressBook()
| Method Detail |
|---|
public Properties getProperties()
public boolean save()
public Object addContact(EmailContact value)
value - the contact to addpublic EmailContact getContact(EmailAddress address)
address - the email address to look up
public EmailContact getContact(EmailAddress address,
EmailContact defValue)
address - the email address to look up
public List<EmailContact> getContacts()
public static EmailContact fromString(String s)
s - the string to parse
public static String createKey(EmailContact value)
value - the object to generate the key for
public static String toString(EmailContact value)
value - the object to convert
public static EmailAddressBook getSingleton()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||