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 represents user's alias which will be expanded to local user's
022     * email address.
023     * 
024     * @author Won Chul Doh
025     * @since Jun 24, 2010
026     * 
027     */
028    public class Alias {
029    
030            private long id;
031    
032            /**
033             * The alias email address.
034             */
035            private String alias;
036    
037            /**
038             * The ID of local user to which mail should be delivered.
039             */
040            private long deliverTo;
041    
042            /**
043             * Local address to which mail should be delivered.
044             */
045            private String userID;
046    
047            public Alias() {
048                    super();
049            }
050    
051            public long getID() {
052                    return id;
053            }
054    
055            public void setID(long id) {
056                    this.id = id;
057            }
058    
059            public String getAlias() {
060                    return alias;
061            }
062    
063            public void setAlias(String alias) {
064                    this.alias = alias;
065            }
066    
067            public long getDeliverTo() {
068                    return deliverTo;
069            }
070    
071            public void setDeliverTo(long deliverTo) {
072                    this.deliverTo = deliverTo;
073            }
074    
075            public String getUserID() {
076                    return userID;
077            }
078    
079            public void setUserID(String userID) {
080                    this.userID = userID;
081            }
082    
083            public String getAliasName() {
084                    return StringUtils.substringBefore(alias, "@");
085            }
086            
087    }