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.XmlAttribute;
24  import javax.xml.bind.annotation.XmlType;
25  import java.io.Serializable;
26  
27  /**
28   * Represents an object reference.
29   * @author Jens Riemschneider
30   */
31  @XmlAccessorType(XmlAccessType.FIELD)
32  @XmlType(name = "ObjectReference", propOrder = {"home", "id"})
33  @EqualsAndHashCode(doNotUseGetters = true)
34  @ToString(doNotUseGetters = true)
35  public class ObjectReference implements Serializable {
36      private static final long serialVersionUID = 5442558815484966722L;
37  
38      @XmlAttribute(name = "uuid")
39      private String id;
40      @XmlAttribute(name = "homeCommunityId")
41      private String home;
42      
43      /**
44       * Constructs an object reference.
45       */
46      public ObjectReference() {}
47      
48      /**
49       * Constructs an object reference.
50       * @param id
51       *          the id of the referenced object.
52       */
53      public ObjectReference(String id) {
54          this.id = id;
55      }
56  
57      /**
58       * Constructs an object reference.
59       * @param id
60       *          the id of the referenced object.
61       * @param home
62       *          the ID of the community that the object was created in.
63       */
64      public ObjectReference(String id, String home) {
65          this.id = id;
66          this.home = home;
67      }
68  
69      /**
70       * @return the id of the referenced object.
71       */
72      public String getId() {
73          return id;
74      }
75      
76      /**
77       * @param id
78       *          the id of the referenced object.
79       */
80      public void setId(String id) {
81          this.id = id;
82      }
83          
84      /**
85       * @return the ID of the community that the object was created in.
86       */
87      public String getHome() {
88          return home;
89      }
90      
91      /**
92       * @param home
93       *          the ID of the community that the object was created in.
94       */
95      public void setHome(String home) {
96          this.home = home;
97      }
98  
99  }