1546622138dc0115f3d10cf45c565d71d0353c87
[aaf/inno.git] / rosetta / src / test / java / com / data / test / obj / SingleMarshal.java
1 /*******************************************************************************\r
2  * ============LICENSE_START====================================================\r
3  * * org.onap.aai\r
4  * * ===========================================================================\r
5  * * Copyright © 2017 AT&T Intellectual Property. All rights reserved.\r
6  * * Copyright © 2017 Amdocs\r
7  * * ===========================================================================\r
8  * * Licensed under the Apache License, Version 2.0 (the "License");\r
9  * * you may not use this file except in compliance with the License.\r
10  * * You may obtain a copy of the License at\r
11  * * \r
12  *  *      http://www.apache.org/licenses/LICENSE-2.0\r
13  * * \r
14  *  * Unless required by applicable law or agreed to in writing, software\r
15  * * distributed under the License is distributed on an "AS IS" BASIS,\r
16  * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
17  * * See the License for the specific language governing permissions and\r
18  * * limitations under the License.\r
19  * * ============LICENSE_END====================================================\r
20  * *\r
21  * * ECOMP is a trademark and service mark of AT&T Intellectual Property.\r
22  * *\r
23  ******************************************************************************/\r
24 package com.data.test.obj;\r
25 \r
26 import java.util.List;\r
27 \r
28 import javax.xml.datatype.XMLGregorianCalendar;\r
29 \r
30 import com.att.rosetta.marshal.DataWriter;\r
31 import com.att.rosetta.marshal.FieldArray;\r
32 import com.att.rosetta.marshal.FieldDate;\r
33 import com.att.rosetta.marshal.FieldDateTime;\r
34 import com.att.rosetta.marshal.FieldHexBinary;\r
35 import com.att.rosetta.marshal.FieldNumeric;\r
36 import com.att.rosetta.marshal.FieldString;\r
37 import com.att.rosetta.marshal.ObjMarshal;\r
38 \r
39 import types.xsd.Multi.Single;\r
40 \r
41 public class SingleMarshal extends ObjMarshal<Single> {\r
42         public SingleMarshal() {\r
43                 add(new FieldString<Single>("str") {\r
44                         @Override\r
45                         protected String data(Single t) {\r
46                                 return t.getStr();\r
47                         }\r
48                 });\r
49                 \r
50                 add(new FieldNumeric<Integer, Single>("int") {\r
51                         @Override\r
52                         protected Integer data(Single t) {\r
53                                 return t.getInt();\r
54                         }\r
55                 });\r
56                 \r
57                 add(new FieldNumeric<Long,Single>("long") {\r
58                         @Override\r
59                         protected Long data(Single t) {\r
60                                 return t.getLong();\r
61                         }\r
62                 });\r
63 \r
64                 add(new FieldDate<Single>("date") {\r
65                         @Override\r
66                         protected XMLGregorianCalendar data(Single t) {\r
67                                 return t.getDate();\r
68                         }\r
69                 });\r
70 \r
71                 add(new FieldDateTime<Single>("datetime") {\r
72                         @Override\r
73                         protected XMLGregorianCalendar data(Single t) {\r
74                                 return t.getDate();\r
75                         }\r
76                 });\r
77                 \r
78                 add(new FieldHexBinary<Single>("binary") {\r
79                         @Override\r
80                         protected byte[] data(Single t) {\r
81                                 return t.getBinary();\r
82                         }\r
83                 });\r
84                 \r
85                 add(new FieldArray<Single,String>("array", DataWriter.STRING) {\r
86                         @Override\r
87                         protected List<String> data(Single t) {\r
88                                 return t.getArray();\r
89                         }\r
90                 });\r
91 \r
92         }\r
93 }\r