001    /*-----------------------------------------------------------------------
002     *  Copyright (C) 2006
003     *  Associated Universities, Inc. Washington DC, USA.
004     *  This program is free software; you can redistribute it and/or
005     *  modify it under the terms of the GNU General Public License as
006     *  published by the Free Software Foundation; either version 2 of
007     *  the License, or (at your option) any later version.
008     *
009     *  This program is distributed in the hope that it will be useful,
010     *  but WITHOUT ANY WARRANTY; without even the implied warranty of
011     *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
012     *  GNU General Public License for more details.
013     *
014     *  Correspondence concerning this software should be addressed as follows:
015     *         Internet email: switz@nrao.edu
016     *         Postal address: User Database
017     *                         National Radio Astronomy Observatory
018     *                         Post Office Box 0
019     *                         Socorro, NM 87801  USA
020     *-----------------------------------------------------------------------*/
021    package edu.nrao.sss.model.user;
022    
023    public abstract class Contact extends UpdateDetails implements XMLable {
024    
025      private static final long serialVersionUID = -1L;
026      
027            public static enum ContactType {
028                    ADDRESS, EMAIL, FAX, PHONE, URL, UNKNOWN
029            }
030    
031            protected ContactType contactType;
032    
033            private String contactDescription;
034    
035            private boolean defaultContact;
036    
037            public Contact() {
038                    contactType = ContactType.UNKNOWN;
039                    defaultContact = false;
040            }
041            
042            public Contact(Contact contact) {
043                    copy(contact);
044            }
045    
046            public void copy(Contact contact) {
047                    super.copy(contact);
048                    set(contact);
049            }
050            
051            public void set(Contact contact) {
052                    this.contactType = contact.contactType;
053                    this.setDefaultContact(contact.isDefaultContact());
054                    this.setContactDescription(contact.getContactDescription());
055            }
056            
057            public String getContactDescription() {
058                    return contactDescription;
059            }
060    
061            public boolean isDefaultContact() {
062                    return defaultContact;
063            }
064    
065            public void setContactDescription(String contactDescription) {
066                    this.contactDescription = contactDescription;
067            }
068    
069            public void setDefaultContact(boolean defaultContact) {
070                    this.defaultContact = defaultContact;
071            }
072    
073            public String toXML() {
074                    return "";
075            }
076    
077            public ContactType getContactType() {
078                    return contactType;
079            }
080    }