001: /*
002: * Copyright 2005-2007 Noelios Consulting.
003: *
004: * The contents of this file are subject to the terms of the Common Development
005: * and Distribution License (the "License"). You may not use this file except in
006: * compliance with the License.
007: *
008: * You can obtain a copy of the license at
009: * http://www.opensource.org/licenses/cddl1.txt See the License for the specific
010: * language governing permissions and limitations under the License.
011: *
012: * When distributing Covered Code, include this CDDL HEADER in each file and
013: * include the License file at http://www.opensource.org/licenses/cddl1.txt If
014: * applicable, add the following below this CDDL HEADER, with the fields
015: * enclosed by brackets "[]" replaced with your own identifying information:
016: * Portions Copyright [yyyy] [name of copyright owner]
017: */
018:
019: package org.restlet.example.book.rest.ch7;
020:
021: import java.util.ArrayList;
022: import java.util.List;
023:
024: /**
025: * User account.
026: *
027: * @author Jerome Louvel (contact@noelios.com)
028: */
029: public class User {
030:
031: private String name;
032:
033: private String fullName;
034:
035: private String email;
036:
037: private String password;
038:
039: private List<Bookmark> bookmarks;
040:
041: public Bookmark getBookmark(String uri) {
042: for (Bookmark bookmark : getBookmarks()) {
043: if (bookmark.getUri().equals(uri))
044: return bookmark;
045: }
046:
047: return null;
048: }
049:
050: /**
051: * @return the modifiable list of bookmarks
052: */
053: public List<Bookmark> getBookmarks() {
054: if (this .bookmarks == null)
055: this .bookmarks = new ArrayList<Bookmark>();
056: return this .bookmarks;
057: }
058:
059: /**
060: * @return the email
061: */
062: public String getEmail() {
063: return this .email;
064: }
065:
066: /**
067: * @param email
068: * the email to set
069: */
070: public void setEmail(String email) {
071: this .email = email;
072: }
073:
074: /**
075: * @return the fullName
076: */
077: public String getFullName() {
078: return this .fullName;
079: }
080:
081: /**
082: * @param fullName
083: * the fullName to set
084: */
085: public void setFullName(String fullName) {
086: this .fullName = fullName;
087: }
088:
089: /**
090: * @return the name
091: */
092: public String getName() {
093: return this .name;
094: }
095:
096: /**
097: * @param name
098: * the name to set
099: */
100: public void setName(String name) {
101: this .name = name;
102: }
103:
104: /**
105: * @return the password
106: */
107: public String getPassword() {
108: return this .password;
109: }
110:
111: /**
112: * @param password
113: * the password to set
114: */
115: public void setPassword(String password) {
116: this.password = password;
117: }
118:
119: }
|