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 javax.xml.bind.annotation.*;
19  import java.io.Serializable;
20  import java.util.ArrayList;
21  import java.util.List;
22  
23  import lombok.EqualsAndHashCode;
24  import lombok.Getter;
25  import lombok.ToString;
26  
27  /**
28   * Represents an XDS folder according to the IHE XDS specification.
29   * <p>
30   * All non-list members of this class are allowed to be <code>null</code>.
31   * The lists are pre-created and can therefore never be <code>null</code>.
32   * 
33   * @author Jens Riemschneider
34   */
35  @XmlAccessorType(XmlAccessType.FIELD)
36  @XmlType(name = "Folder", propOrder = {"lastUpdateTime", "codeList"})
37  @XmlRootElement(name = "folder")
38  @EqualsAndHashCode(callSuper = true, doNotUseGetters = true)
39  @ToString(callSuper = true, doNotUseGetters = true)
40  public class Folder extends XDSMetaClass implements Serializable {
41      private static final long serialVersionUID = -1923451867453561796L;
42      
43      @XmlElement(name = "code")
44      @Getter private final List<Code> codeList = new ArrayList<>();
45      @Getter private Timestamp lastUpdateTime;
46  
47  
48      public void setLastUpdateTime(Timestamp lastUpdateTime) {
49          this.lastUpdateTime = lastUpdateTime;
50      }
51  
52      public void setLastUpdateTime(String lastUpdateTime) {
53          this.lastUpdateTime = Timestamp.fromHL7(lastUpdateTime);
54      }
55  
56  }