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.processor.fetch;
017    
018    /**
019     * 
020     * @author Won Chul Doh
021     * @since Mar 8, 2010
022     *
023     */
024    public class Address {
025    
026        /** Empty array */
027        public static final Address[] EMPTY = {};
028    
029        private final String atDomainList;
030    
031        private final String hostName;
032    
033        private final String mailboxName;
034    
035        private final String personalName;
036    
037        public Address(String atDomainList, String hostName, String mailboxName,
038                            String personalName) {
039                    super();
040                    this.atDomainList = atDomainList;
041                    this.hostName = hostName;
042                    this.mailboxName = mailboxName;
043                    this.personalName = personalName;
044            }
045    
046            /**
047         * Gets the personal name.
048         * 
049         * @return personal name, or null if the personal name is
050         *         <code>NIL</code>
051         */
052        public String getPersonalName() {
053            return personalName;
054        }
055    
056        /**
057         * Gets the SMTP source route.
058         * 
059         * @return SMTP at-domain-list, or null if the list if
060         *         <code>NIL</code>
061         */
062        public String getAtDomainList() {
063            return atDomainList;
064        }
065    
066        /**
067         * Gets the mailbox name.
068         * 
069         * @return the mailbox name or the group name when
070         *         {@link #getHostName()} is null
071         */
072        public String getMailboxName() {
073            return mailboxName;
074        }
075    
076        /**
077         * Gets the host name.
078         * 
079         * @return the host name, or null when this address marks the start
080         *         or end of a group
081         */
082        public String getHostName() {
083            return hostName;
084        }
085            
086    }