001    /*
002     * Copyright 2010 the original author or authors.
003     * 
004     *  Licensed under the Apache License, Version 2.0 (the "License");
005     *  you may not use this file except in compliance with the License.
006     *  You may obtain a copy of the License at
007     *
008     *      http://www.apache.org/licenses/LICENSE-2.0
009     *
010     *  Unless required by applicable law or agreed to in writing, software
011     *  distributed under the License is distributed on an "AS IS" BASIS,
012     *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013     *  See the License for the specific language governing permissions and
014     *  limitations under the License.
015     */
016    package com.hs.mail.imap.user;
017    
018    import org.apache.commons.lang.StringUtils;
019    
020    /**
021     * This class implements object representing user who has account in the Mail
022     * server.
023     * 
024     * @author Won Chul Doh
025     * @since Mar 17, 2010
026     * 
027     */
028    public class User {
029            
030            private long id;
031    
032            /**
033             * The user's email address.
034             */
035            private String userID;
036    
037            /**
038             * User's login password.
039             */
040            private String passwd;
041            
042            /**
043             * The mail address to which this user's email is forwarded.
044             */
045            private String forwardTo;
046            
047            private long quota;
048            
049            public User() {
050                    super();
051            }
052    
053            public long getID() {
054                    return id;
055            }
056    
057            public void setID(long id) {
058                    this.id = id;
059            }
060    
061            public String getUserID() {
062                    return userID;
063            }
064    
065            public void setUserID(String userID) {
066                    this.userID = userID;
067            }
068    
069            public String getPassword() {
070                    return passwd;
071            }
072    
073            public void setPassword(String passwd) {
074                    this.passwd = passwd;
075            }
076    
077            public String getForwardTo() {
078                    return forwardTo;
079            }
080    
081            public void setForwardTo(String forwardTo) {
082                    this.forwardTo = forwardTo;
083            }
084    
085            public long getQuota() {
086                    return quota;
087            }
088    
089            public void setQuota(long quota) {
090                    this.quota = quota;
091            }
092            
093            public String getUserName() {
094                    return StringUtils.substringBefore(userID, "@");
095            }
096    
097    }