2 * Copyright (c) 2014 Contextream, 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.lispflowmapping.lisp.serializer.address;
10 import java.nio.ByteBuffer;
12 import org.opendaylight.lispflowmapping.lisp.type.AddressFamilyNumberEnum;
13 import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.LispAFIAddress;
14 import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.LispNoAddress;
15 import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.lispaddress.lispaddresscontainer.address.no.NoAddressBuilder;
17 public class LispNoAddressSerializer extends LispAddressSerializer {
19 private static final LispNoAddressSerializer INSTANCE = new LispNoAddressSerializer();
21 // Private constructor prevents instantiation from other classes
22 private LispNoAddressSerializer() {
25 public static LispNoAddressSerializer getInstance() {
30 public int getAddressSize(LispAFIAddress lispAddress) {
35 protected void serializeData(ByteBuffer buffer, LispAFIAddress lispAddress) {
39 protected LispNoAddress deserializeData(ByteBuffer buffer) {
40 return new NoAddressBuilder().setAfi(AddressFamilyNumberEnum.NO_ADDRESS.getIanaCode()).build();
43 private interface Length {