Fixed RESTConf support for identity-ref build-in datatype
[controller.git] / opendaylight / md-sal / sal-rest-connector / src / main / java / org / opendaylight / controller / sal / restconf / impl / IdentityValuesDTO.java
1 package org.opendaylight.controller.sal.restconf.impl;
2
3 import java.util.ArrayList;
4 import java.util.Collections;
5 import java.util.List;
6
7 public final class IdentityValuesDTO {
8
9     private final List<IdentityValue> elementData = new ArrayList<>();
10
11     public IdentityValuesDTO(String namespace, String value, String prefix) {
12         elementData.add(new IdentityValue(namespace, value, prefix));
13     }
14
15     public void add(String namespace, String value, String prefix) {
16         elementData.add(new IdentityValue(namespace, value, prefix));
17     }
18
19     public List<IdentityValue> getValuesWithNamespaces() {
20         return Collections.unmodifiableList(elementData);
21     }
22
23     public static final class IdentityValue {
24
25         private String namespace;
26         private String value;
27         private String prefix;
28
29         public IdentityValue(String namespace, String value, String prefix) {
30             this.namespace = namespace;
31             this.value = value;
32             this.prefix = prefix;
33         }
34
35         public String getNamespace() {
36             return namespace;
37         }
38
39         public void setNamespace(String namespace) {
40             this.namespace = namespace;
41         }
42
43         public String getValue() {
44             return value;
45         }
46
47         public void setValue(String value) {
48             this.value = value;
49         }
50
51         public String getPrefix() {
52             return prefix;
53         }
54
55         public void setPrefix(String prefix) {
56             this.prefix = prefix;
57         }
58
59     }
60 }