1 /*******************************************************************************
\r
2 * ============LICENSE_START====================================================
\r
4 * * ===========================================================================
\r
5 * * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
\r
6 * * ===========================================================================
\r
7 * * Licensed under the Apache License, Version 2.0 (the "License");
\r
8 * * you may not use this file except in compliance with the License.
\r
9 * * You may obtain a copy of the License at
\r
11 * * http://www.apache.org/licenses/LICENSE-2.0
\r
13 * * Unless required by applicable law or agreed to in writing, software
\r
14 * * distributed under the License is distributed on an "AS IS" BASIS,
\r
15 * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
\r
16 * * See the License for the specific language governing permissions and
\r
17 * * limitations under the License.
\r
18 * * ============LICENSE_END====================================================
\r
20 * * ECOMP is a trademark and service mark of AT&T Intellectual Property.
\r
22 ******************************************************************************/
\r
23 package com.data.test.obj;
\r
25 import java.util.List;
\r
27 import javax.xml.datatype.XMLGregorianCalendar;
\r
29 import org.onap.aaf.rosetta.marshal.DataWriter;
\r
30 import org.onap.aaf.rosetta.marshal.FieldArray;
\r
31 import org.onap.aaf.rosetta.marshal.FieldDate;
\r
32 import org.onap.aaf.rosetta.marshal.FieldDateTime;
\r
33 import org.onap.aaf.rosetta.marshal.FieldHexBinary;
\r
34 import org.onap.aaf.rosetta.marshal.FieldNumeric;
\r
35 import org.onap.aaf.rosetta.marshal.FieldString;
\r
36 import org.onap.aaf.rosetta.marshal.ObjMarshal;
\r
38 import types.xsd.Multi.Single;
\r
40 public class SingleMarshal extends ObjMarshal<Single> {
\r
41 public SingleMarshal() {
\r
42 add(new FieldString<Single>("str") {
\r
44 protected String data(Single t) {
\r
49 add(new FieldNumeric<Integer, Single>("int") {
\r
51 protected Integer data(Single t) {
\r
56 add(new FieldNumeric<Long,Single>("long") {
\r
58 protected Long data(Single t) {
\r
63 add(new FieldDate<Single>("date") {
\r
65 protected XMLGregorianCalendar data(Single t) {
\r
70 add(new FieldDateTime<Single>("datetime") {
\r
72 protected XMLGregorianCalendar data(Single t) {
\r
77 add(new FieldHexBinary<Single>("binary") {
\r
79 protected byte[] data(Single t) {
\r
80 return t.getBinary();
\r
84 add(new FieldArray<Single,String>("array", DataWriter.STRING) {
\r
86 protected List<String> data(Single t) {
\r
87 return t.getArray();
\r