2 * Copyright © 2021 Orange, Inc. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
8 package org.opendaylight.transportpce.dmaap.client.resource.config;
10 import com.fasterxml.jackson.core.JsonGenerator;
11 import com.fasterxml.jackson.databind.SerializerProvider;
12 import com.fasterxml.jackson.databind.ser.std.StdSerializer;
13 import java.io.IOException;
14 import org.opendaylight.yang.gen.v1.http.org.openroadm.common.service.types.rev190531.service.lgx.Lgx;
16 // This class is a temporary workaround while waiting jackson
17 // support in yang tools https://git.opendaylight.org/gerrit/c/yangtools/+/94852
18 public class LgxSerializer extends StdSerializer<Lgx> {
19 private static final long serialVersionUID = 1L;
21 public LgxSerializer() {
26 public void serialize(Lgx value, JsonGenerator gen, SerializerProvider provider) throws IOException {
28 gen.writeStartObject();
29 gen.writeStringField("lgx-port-rack", value.getLgxPortRack());
30 gen.writeStringField("lgx-port-shelf", value.getLgxPortShelf());
31 gen.writeStringField("lgx-device-name", value.getLgxDeviceName());
32 gen.writeStringField("lgx-port-name", value.getLgxPortName());