*/
package org.opendaylight.lispflowmapping.lisp.serializer.address;
+import static org.opendaylight.yangtools.yang.common.UintConversions.fromJava;
+
import java.nio.ByteBuffer;
import org.opendaylight.lispflowmapping.lisp.type.LispCanonicalAddressFormatEnum;
import org.opendaylight.lispflowmapping.lisp.util.ByteUtil;
ServicePath sp = (ServicePath) lispAddress.getAddress();
buffer.put(ByteUtil.partialIntToByteArray(NumberUtil.asInt(
sp.getServicePath().getServicePathId().getValue().intValue()), Length.SPI));
- buffer.put((byte) NumberUtil.asShort(sp.getServicePath().getServiceIndex()));
+ buffer.put((byte) NumberUtil.asShort(sp.getServicePath().getServiceIndex().toJava()));
}
@Override
ServicePathBuilder spb = new ServicePathBuilder();
byte[] spi = new byte[3];
buffer.get(spi);
- spb.setServicePathId(new ServicePathIdType((long) ByteUtil.getPartialInt(spi)));
- spb.setServiceIndex((short) ByteUtil.getUnsignedByte(buffer));
+ spb.setServicePathId(new ServicePathIdType(fromJava((long) ByteUtil.getPartialInt(spi))));
+ spb.setServiceIndex(fromJava((short) ByteUtil.getUnsignedByte(buffer)));
return new org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105
.lisp.address.address.ServicePathBuilder().setServicePath(spb.build()).build();
}