2 * ============LICENSE_START====================================================
4 * ===========================================================================
5 * Copyright (c) 2018 AT&T Intellectual Property. All rights reserved.
6 * ===========================================================================
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 * ============LICENSE_END====================================================
22 package org.onap.aaf.misc.rosetta.test.obj;
24 import java.util.List;
26 import javax.xml.datatype.XMLGregorianCalendar;
28 import org.onap.aaf.misc.rosetta.marshal.DataWriter;
29 import org.onap.aaf.misc.rosetta.marshal.FieldArray;
30 import org.onap.aaf.misc.rosetta.marshal.FieldDate;
31 import org.onap.aaf.misc.rosetta.marshal.FieldDateTime;
32 import org.onap.aaf.misc.rosetta.marshal.FieldHexBinary;
33 import org.onap.aaf.misc.rosetta.marshal.FieldNumeric;
34 import org.onap.aaf.misc.rosetta.marshal.FieldString;
35 import org.onap.aaf.misc.rosetta.marshal.ObjMarshal;
37 import types.xsd.Multi.Single;
39 public class SingleMarshal extends ObjMarshal<Single> {
40 public SingleMarshal() {
41 add(new FieldString<Single>("str") {
43 protected String data(Single t) {
48 add(new FieldNumeric<Integer, Single>("int") {
50 protected Integer data(Single t) {
55 add(new FieldNumeric<Long,Single>("long") {
57 protected Long data(Single t) {
62 add(new FieldDate<Single>("date") {
64 protected XMLGregorianCalendar data(Single t) {
69 add(new FieldDateTime<Single>("datetime") {
71 protected XMLGregorianCalendar data(Single t) {
76 add(new FieldHexBinary<Single>("binary") {
78 protected byte[] data(Single t) {
83 add(new FieldArray<Single,String>("array", DataWriter.STRING) {
85 protected List<String> data(Single t) {