~ubuntu-branches/ubuntu/saucy/restlet/saucy

« back to all changes in this revision

Viewing changes to org.restlet.example/src/org/restlet/example/book/rest/ch7/User.java

  • Committer: Package Import Robot
  • Author(s): James Page
  • Date: 2012-06-11 16:25:45 UTC
  • Revision ID: package-import@ubuntu.com-20120611162545-5w2o0resi5y3pybc
Tags: upstream-2.0.14
ImportĀ upstreamĀ versionĀ 2.0.14

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/**
 
2
 * Copyright 2005-2012 Restlet S.A.S.
 
3
 * 
 
4
 * The contents of this file are subject to the terms of one of the following
 
5
 * open source licenses: Apache 2.0 or LGPL 3.0 or LGPL 2.1 or CDDL 1.0 or EPL
 
6
 * 1.0 (the "Licenses"). You can select the license that you prefer but you may
 
7
 * not use this file except in compliance with one of these Licenses.
 
8
 * 
 
9
 * You can obtain a copy of the Apache 2.0 license at
 
10
 * http://www.opensource.org/licenses/apache-2.0
 
11
 * 
 
12
 * You can obtain a copy of the LGPL 3.0 license at
 
13
 * http://www.opensource.org/licenses/lgpl-3.0
 
14
 * 
 
15
 * You can obtain a copy of the LGPL 2.1 license at
 
16
 * http://www.opensource.org/licenses/lgpl-2.1
 
17
 * 
 
18
 * You can obtain a copy of the CDDL 1.0 license at
 
19
 * http://www.opensource.org/licenses/cddl1
 
20
 * 
 
21
 * You can obtain a copy of the EPL 1.0 license at
 
22
 * http://www.opensource.org/licenses/eclipse-1.0
 
23
 * 
 
24
 * See the Licenses for the specific language governing permissions and
 
25
 * limitations under the Licenses.
 
26
 * 
 
27
 * Alternatively, you can obtain a royalty free commercial license with less
 
28
 * limitations, transferable or non-transferable, directly at
 
29
 * http://www.restlet.com/products/restlet-framework
 
30
 * 
 
31
 * Restlet is a registered trademark of Restlet S.A.S.
 
32
 */
 
33
 
 
34
package org.restlet.example.book.rest.ch7;
 
35
 
 
36
import java.util.ArrayList;
 
37
import java.util.List;
 
38
 
 
39
/**
 
40
 * User account.
 
41
 * 
 
42
 * @author Jerome Louvel
 
43
 */
 
44
public class User {
 
45
 
 
46
    private String name;
 
47
 
 
48
    private String fullName;
 
49
 
 
50
    private String email;
 
51
 
 
52
    private String password;
 
53
 
 
54
    private List<Bookmark> bookmarks;
 
55
 
 
56
    public Bookmark getBookmark(String uri) {
 
57
        for (final Bookmark bookmark : getBookmarks()) {
 
58
            if (bookmark.getUri().equals(uri)) {
 
59
                return bookmark;
 
60
            }
 
61
        }
 
62
 
 
63
        return null;
 
64
    }
 
65
 
 
66
    /**
 
67
     * @return the modifiable list of bookmarks
 
68
     */
 
69
    public List<Bookmark> getBookmarks() {
 
70
        if (this.bookmarks == null) {
 
71
            this.bookmarks = new ArrayList<Bookmark>();
 
72
        }
 
73
        return this.bookmarks;
 
74
    }
 
75
 
 
76
    /**
 
77
     * @return the email
 
78
     */
 
79
    public String getEmail() {
 
80
        return this.email;
 
81
    }
 
82
 
 
83
    /**
 
84
     * @return the fullName
 
85
     */
 
86
    public String getFullName() {
 
87
        return this.fullName;
 
88
    }
 
89
 
 
90
    /**
 
91
     * @return the name
 
92
     */
 
93
    public String getName() {
 
94
        return this.name;
 
95
    }
 
96
 
 
97
    /**
 
98
     * @return the password
 
99
     */
 
100
    public String getPassword() {
 
101
        return this.password;
 
102
    }
 
103
 
 
104
    /**
 
105
     * @param email
 
106
     *            the email to set
 
107
     */
 
108
    public void setEmail(String email) {
 
109
        this.email = email;
 
110
    }
 
111
 
 
112
    /**
 
113
     * @param fullName
 
114
     *            the fullName to set
 
115
     */
 
116
    public void setFullName(String fullName) {
 
117
        this.fullName = fullName;
 
118
    }
 
119
 
 
120
    /**
 
121
     * @param name
 
122
     *            the name to set
 
123
     */
 
124
    public void setName(String name) {
 
125
        this.name = name;
 
126
    }
 
127
 
 
128
    /**
 
129
     * @param password
 
130
     *            the password to set
 
131
     */
 
132
    public void setPassword(String password) {
 
133
        this.password = password;
 
134
    }
 
135
 
 
136
}