Added x-onap-requestorid to common-header for LCM commands
[appc.git] / appc-client / code-generator / src / main / resources / templates / client-kit / pojo.ftl
1 <#--
2  ============LICENSE_START=======================================================
3  ONAP : APPC
4  ================================================================================
5  Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
6  ================================================================================
7  Copyright (C) 2017 Amdocs
8  =============================================================================
9  Licensed under the Apache License, Version 2.0 (the "License");
10  you may not use this file except in compliance with the License.
11  You may obtain a copy of the License at
12  
13       http://www.apache.org/licenses/LICENSE-2.0
14  
15  Unless required by applicable law or agreed to in writing, software
16  distributed under the License is distributed on an "AS IS" BASIS,
17  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18  See the License for the specific language governing permissions and
19  limitations under the License.
20  
21  ECOMP is a trademark and service mark of AT&T Intellectual Property.
22  ============LICENSE_END=========================================================
23 -->
24
25 /**
26  * NOTE: This file is auto-generated and should not be changed manually.
27  */
28 package ${meta.model\.package};
29
30 import com.fasterxml.jackson.annotation.JsonAutoDetect;
31 import com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility;
32 import com.fasterxml.jackson.annotation.JsonProperty;
33
34 <#if pojo.description??>
35 /**
36  * ${pojo.description}
37  */
38 </#if>
39 <@generated/>
40 @JsonAutoDetect(fieldVisibility = Visibility.ANY, getterVisibility = Visibility.NONE, setterVisibility = Visibility.NONE)
41 public class ${objectName} {
42
43 <#assign properties = pojo.properties>
44 <#list properties?keys as member>
45     <#if properties[member]?is_hash>
46         <#assign varName = toJavaName(member)>
47         <#if properties[member].type??>
48             <#assign property = properties[member]>
49         <#else>
50             <#assign ref = properties[member].$ref?keep_after_last("/")>
51             <#assign property = model.definitions[ref]>
52         </#if>
53         <#if properties[member].enum??>
54             <#assign varType = property.type?cap_first>
55     public enum ${varName?cap_first} {
56             <#list property.enum as enum>
57         ${enum}<#if enum?has_next>,<#else>;</#if>
58             </#list>
59     }
60
61     @JsonProperty("${member}")
62     private ${varName?cap_first} ${varName};
63         <#else>
64             <#if properties[member].$ref??>
65                 <#assign varType = toJavaType(ref)>
66             <#else>
67                 <#assign varType = toJavaType(property.type)>
68             </#if>
69     @JsonProperty("${member}")
70     private ${varType} ${varName};
71         </#if>
72     </#if>
73
74 </#list>
75 <#list properties?keys as member>
76     <#if properties[member]?is_hash>
77         <#if properties[member].type??>
78             <#assign property = properties[member]>
79         <#elseif properties[member].$ref??>
80             <#assign ref = properties[member].$ref?keep_after_last("/")>
81             <#assign property = model.definitions[ref]>
82         </#if>
83         <#if properties[member].$ref??>
84             <#assign varType = ref>
85         <#else>
86             <#assign varType = toJavaType(property.type)>
87         </#if>
88         <#if property.enum??>
89             <#assign varType = toJavaName(member)?cap_first>
90         </#if>
91         <#assign varName = toJavaName(member)>
92         <#if property.description??>
93     /**
94      * ${property.description}
95      */
96         </#if>
97     public ${varType} get${varName?cap_first}() {
98         return ${varName};
99     }
100
101         <#if property.description??>
102     /**
103      * ${property.description}
104      */
105         </#if>
106     public void set${toJavaName(member)?cap_first}(${varType} ${varName}) {
107         this.${varName} = ${varName};
108     }
109
110     </#if>
111 </#list>
112 }