View Javadoc
1   /*
2    * Copyright 2017 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.audit.types;
17  
18  import lombok.EqualsAndHashCode;
19  import lombok.Getter;
20  import lombok.Setter;
21  
22  import static java.util.Objects.requireNonNull;
23  
24  /**
25   * @author Christian Ohr
26   * @since 3.5
27   */
28  @EqualsAndHashCode
29  class CodedValueTypeImpl implements CodedValueType {
30  
31      @Getter
32      private final String code;
33  
34      @Getter
35      private final String originalText;
36  
37      @Getter
38      private final String codeSystemName;
39  
40      @Getter @Setter
41      private String displayName;
42  
43      CodedValueTypeImpl(String code, String codeSystemName, String originalText) {
44          this.code = requireNonNull(code, "code of CodedValueType must be not null");
45          this.codeSystemName = requireNonNull(codeSystemName, "codeSystemName of CodedValueType must be not null");
46          this.originalText = requireNonNull(originalText, "originalText of CodedValueType must be not null");
47      }
48  
49      CodedValueTypeImpl(CodedValueType codedValueType) {
50          this(codedValueType.getCode(), codedValueType.getCodeSystemName(), codedValueType.getOriginalText());
51      }
52  
53  }