/******************************************************************************* * Copyright 2014 Federal Chancellery Austria * MOA-ID has been developed in a cooperation between BRZ, the Federal * Chancellery Austria - ICT staff unit, and Graz University of Technology. * * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by * the European Commission - subsequent versions of the EUPL (the "Licence"); * You may not use this work except in compliance with the Licence. * You may obtain a copy of the Licence at: * http://www.osor.eu/eupl/ * * Unless required by applicable law or agreed to in writing, software * distributed under the Licence is distributed on an "AS IS" basis, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the Licence for the specific language governing permissions and * limitations under the Licence. * * This product combines work with different licenses. See the "NOTICE" text * file for details on the various modules and licenses. * The "NOTICE" text file is part of the distribution. Any derivative works * that you distribute must include a readable copy of the "NOTICE" text file. *******************************************************************************/ package at.gv.egovernment.moa.id.configuration.data.pvp2; import java.util.ArrayList; import java.util.List; import at.gv.egovernment.moa.id.commons.db.dao.config.deprecated.Contact; public class ContactForm { private String surname; private String givenname; private List mail; private String type; private String company; private List phone; public ContactForm() { } public ContactForm(Contact dbcont) { this.surname = dbcont.getSurName(); this.givenname = dbcont.getGivenName(); if (dbcont.getMail() != null) { this.mail = new ArrayList(); this.mail.addAll(dbcont.getMail()); } if (dbcont.getPhone() != null) { this.phone = new ArrayList(); this.phone.addAll(dbcont.getPhone()); } this.company = dbcont.getCompany(); this.type = dbcont.getType(); } /** * @return the surname */ public String getSurname() { return surname; } /** * @param surname the surname to set */ public void setSurname(String surname) { this.surname = surname; } /** * @return the givenname */ public String getGivenname() { return givenname; } /** * @param givenname the givenname to set */ public void setGivenname(String givenname) { this.givenname = givenname; } /** * @return the mail */ public String getMail() { if (mail.size() > 0) return mail.get(0); else return null; } /** * @param mail the mail to set */ public void setMail(String mail) { if (this.mail == null) this.mail = new ArrayList(); this.mail.add(mail); } /** * @return the type */ public String getType() { return type; } /** * @param type the type to set */ public void setType(String type) { this.type = type; } /** * @return the company */ public String getCompany() { return company; } /** * @param company the company to set */ public void setCompany(String company) { this.company = company; } /** * @return the phone */ public String getPhone() { if (phone.size() > 0) return phone.get(0); else return null; } /** * @param phone the phone to set */ public void setPhone(String phone) { if (this.phone == null) this.phone = new ArrayList(); this.phone.add(phone); } }