OSDN Git Service

全てのjavaファイルにモードライン追加。
[rabbit-bts/RabbitBTS.git] / src / jp / sourceforge / rabbitBTS / models / Account.java
1 // vim:set ts=4 sts=4 sw=4 noet fenc=utf-8:
2 /*
3    Copyright 2009 senju@users.sourceforge.jp
4
5    Licensed under the Apache License, Version 2.0 (the "License");
6    you may not use this file except in compliance with the License.
7    You may obtain a copy of the License at
8
9        http://www.apache.org/licenses/LICENSE-2.0
10
11    Unless required by applicable law or agreed to in writing, software
12    distributed under the License is distributed on an "AS IS" BASIS,
13    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14    See the License for the specific language governing permissions and
15    limitations under the License.
16  */
17
18 package jp.sourceforge.rabbitBTS.models;
19
20 import java.util.Date;
21
22 import javax.jdo.annotations.IdGeneratorStrategy;
23 import javax.jdo.annotations.IdentityType;
24 import javax.jdo.annotations.PersistenceCapable;
25 import javax.jdo.annotations.Persistent;
26 import javax.jdo.annotations.PrimaryKey;
27
28 import org.springmodules.validation.bean.conf.loader.annotation.handler.Email;
29 import org.springmodules.validation.bean.conf.loader.annotation.handler.Length;
30 import org.springmodules.validation.bean.conf.loader.annotation.handler.NotBlank;
31 import org.springmodules.validation.bean.conf.loader.annotation.handler.NotNull;
32
33 @PersistenceCapable(identityType = IdentityType.APPLICATION)
34 public class Account {
35         @PrimaryKey
36         @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
37         private Long accountId;
38
39         /**
40          * ユーザーのニックネーム。変更可能とする。
41          */
42         @Persistent
43         @NotBlank
44         @NotNull
45         @Length(max = 10)
46         // TODO: 短い
47         private String nickName;
48
49         /**
50          * ユーザーのemail。googleアカウント使用時は変更不可とする。
51          */
52         @Persistent
53         @Email
54         @NotBlank
55         @NotNull
56         private String email;
57
58         /**
59          * 自己紹介
60          */
61         @Persistent
62         @NotBlank
63         @NotNull
64         @Length(max = 255)
65         // TODO:サロゲートありで満杯までいれると500byte越えるかもね。
66         private String bio;
67
68         /**
69          * 最後にシステムにアクセスした日時
70          */
71         @Persistent
72         @NotNull
73         private Date lastAccess;
74
75         /**
76          * 管理者権限を持つかどうか
77          */
78         @Persistent
79         private boolean admin;
80
81         public Long getAccountId() {
82                 return this.accountId;
83         }
84
85         public Date getLastAccess() {
86                 return this.lastAccess;
87         }
88
89         /**
90          * @return the bio
91          */
92         public String getBio() {
93                 return this.bio;
94         }
95
96         public void setLastAccess(Date lastAccess) {
97                 this.lastAccess = lastAccess;
98         }
99
100         /**
101          * @param bio
102          *            the bio to set
103          */
104         public void setBio(String bio) {
105                 this.bio = bio;
106         }
107
108         /**
109          * @param accountId
110          *            the accountId to set
111          */
112         public void setAccountId(Long accountId) {
113                 this.accountId = accountId;
114         }
115
116         /**
117          * @return the nickName
118          */
119         public String getNickName() {
120                 return this.nickName;
121         }
122
123         /**
124          * @return the email
125          */
126         public String getEmail() {
127                 return this.email;
128         }
129
130         /**
131          * @param nickName
132          *            the nickName to set
133          */
134         public void setNickName(String nickName) {
135                 this.nickName = nickName;
136         }
137
138         /**
139          * @param email
140          *            the email to set
141          */
142         public void setEmail(String email) {
143                 this.email = email;
144         }
145
146         /**
147          * @return the admin
148          */
149         public boolean isAdmin() {
150                 return this.admin;
151         }
152
153         /**
154          * @param admin
155          *            the admin to set
156          */
157         public void setAdmin(boolean isAdmin) {
158                 this.admin = isAdmin;
159         }
160 }