View Javadoc
1   /*
2    * Copyright 2009 the original author or authors.
3    * 
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    *     http://www.apache.org/licenses/LICENSE-2.0
9    *     
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  package org.openehealth.ipf.commons.ihe.xds.core.metadata;
17  
18  import lombok.EqualsAndHashCode;
19  import lombok.ToString;
20  
21  import javax.xml.bind.annotation.XmlAccessType;
22  import javax.xml.bind.annotation.XmlAccessorType;
23  import javax.xml.bind.annotation.XmlType;
24  import java.io.Serializable;
25  import java.util.ArrayList;
26  import java.util.List;
27  
28  /**
29   * Represents the human or machine that created an entry.
30   * <p>
31   * All non-list members of this class are allowed to be <code>null</code>.
32   * The lists are pre-created and can therefore never be <code>null</code>.
33   * 
34   * @author Jens Riemschneider
35   */
36  @XmlAccessorType(XmlAccessType.FIELD)
37  @XmlType(name = "Author", propOrder = {"authorPerson", "authorInstitution",
38          "authorSpecialty", "authorRole", "authorTelecom"})
39  @EqualsAndHashCode(doNotUseGetters = true)
40  @ToString(doNotUseGetters = true)
41  public class Author implements Serializable {
42      private static final long serialVersionUID = 6731221295927724760L;
43      
44      private Person authorPerson;
45      private final List<Organization> authorInstitution = new ArrayList<>();
46      private final List<Identifiable> authorRole = new ArrayList<>();
47      private final List<Identifiable> authorSpecialty = new ArrayList<>();
48      private final List<Telecom> authorTelecom = new ArrayList<>();
49  
50      /**
51       * @return basic information about the author.
52       */
53      public Person getAuthorPerson() {
54          return authorPerson;
55      }
56      
57      /**
58       * @param authorPerson
59       *          basic information about the author.
60       */
61      public void setAuthorPerson(Person authorPerson) {        
62          this.authorPerson = authorPerson;
63      }
64  
65      /**
66       * @return the list of author institutions. Never <code>null</code>, but
67       *          can be empty. 
68       */
69      public List<Organization> getAuthorInstitution() {
70          return authorInstitution;
71      }
72      
73      /**
74       * @return the list of author roles. Never <code>null</code>, but
75       *          can be empty. 
76       */
77      public List<Identifiable> getAuthorRole() {
78          return authorRole;
79      }
80      
81      /**
82       * @return the list of author specialties. Never <code>null</code>, but
83       *          can be empty. 
84       */
85      public List<Identifiable> getAuthorSpecialty() {
86          return authorSpecialty;
87      }
88  
89      /**
90       * @return the list of author telecommunication addresses.
91       *          Never <code>null</code>, but can be empty.
92       */
93      public List<Telecom> getAuthorTelecom() {
94          return authorTelecom;
95      }
96  
97  }