|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.glassfish.jersey.examples.beanvalidation.webapp.service.StorageService
public class StorageService
Simple storage of contacts.
| Constructor Summary | |
|---|---|
StorageService()
|
|
| Method Summary | |
|---|---|
static ContactCard |
addContact(ContactCard contact)
Adds a contact into the storage. |
static List<ContactCard> |
clear()
Removes all contacts from the storage. |
static List<ContactCard> |
findByEmail(String emailPart)
Finds contacts whose email contains emailPart as a substring. |
static List<ContactCard> |
findByName(String namePart)
Finds contacts whose name contains namePart as a substring. |
static List<ContactCard> |
findByPhone(String phonePart)
Finds contacts whose phone contains phonePart as a substring. |
static ContactCard |
get(Long id)
Retrieves contact with given id. |
static ContactCard |
remove(Long id)
Removes contact with given id. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public StorageService()
| Method Detail |
|---|
public static ContactCard addContact(ContactCard contact)
null value is returned.
contact - contact to be added.
id field, null if the contact already exist in the storage.public static List<ContactCard> clear()
public static ContactCard remove(Long id)
id.
id - id of the contact to be removed.
null if the contact is not present in the storage.public static ContactCard get(Long id)
id.
id - id of the contact to be retrieved.
null if the contact is not present in the storage.public static List<ContactCard> findByEmail(String emailPart)
emailPart as a substring.
emailPart - search phrase.
public static List<ContactCard> findByName(String namePart)
namePart as a substring.
namePart - search phrase.
public static List<ContactCard> findByPhone(String phonePart)
phonePart as a substring.
phonePart - search phrase.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||