Remove EncodeConstants.SIZE_OF_{BYTE,SHORT,INT,LONG}_IN_BYTES 80/92380/14
authorRobert Varga <robert.varga@pantheon.tech>
Wed, 2 Sep 2020 13:03:11 +0000 (15:03 +0200)
committerRobert Varga <robert.varga@pantheon.tech>
Fri, 11 Sep 2020 19:32:32 +0000 (21:32 +0200)
These constants are exposed since Java 8 as
{Byte,Short,Integer,Long}.BYTES use them from there instead of
brewing our own.

Change-Id: I3a47659f136165d54f3f97315b0911cc7feaec6b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
311 files changed:
extension/openflowjava-extension-eric/src/main/java/org/opendaylight/openflowjava/eric/codec/match/AbstractMatchCodec.java
extension/openflowjava-extension-nicira/src/main/java/org/opendaylight/openflowjava/nx/codec/action/AbstractActionCodec.java
extension/openflowjava-extension-nicira/src/main/java/org/opendaylight/openflowjava/nx/codec/action/ActionDeserializer.java
extension/openflowjava-extension-nicira/src/main/java/org/opendaylight/openflowjava/nx/codec/action/ConntrackCodec.java
extension/openflowjava-extension-nicira/src/main/java/org/opendaylight/openflowjava/nx/codec/action/EncapCodec.java
extension/openflowjava-extension-nicira/src/main/java/org/opendaylight/openflowjava/nx/codec/action/LearnCodecUtil.java
extension/openflowjava-extension-nicira/src/main/java/org/opendaylight/openflowjava/nx/codec/action/RegLoad2Codec.java
extension/openflowjava-extension-nicira/src/main/java/org/opendaylight/openflowjava/nx/codec/match/AbstractExperimenterMatchCodec.java
extension/openflowjava-extension-nicira/src/main/java/org/opendaylight/openflowjava/nx/codec/match/AbstractMatchCodec.java
extension/openflowjava-extension-nicira/src/main/java/org/opendaylight/openflowjava/nx/codec/match/AbstractNshcCodec.java
extension/openflowjava-extension-nicira/src/main/java/org/opendaylight/openflowjava/nx/codec/match/NshFlagsCodec.java
extension/openflowjava-extension-nicira/src/main/java/org/opendaylight/openflowjava/nx/codec/match/NshMdtypeCodec.java
extension/openflowjava-extension-nicira/src/main/java/org/opendaylight/openflowjava/nx/codec/match/NshNpCodec.java
extension/openflowjava-extension-nicira/src/main/java/org/opendaylight/openflowjava/nx/codec/match/NshTtlCodec.java
extension/openflowjava-extension-nicira/src/main/java/org/opendaylight/openflowjava/nx/codec/match/NsiCodec.java
extension/openflowjava-extension-nicira/src/main/java/org/opendaylight/openflowjava/nx/codec/match/NspCodec.java
extension/openflowjava-extension-nicira/src/test/java/org/opendaylight/openflowjava/nx/codec/match/AbstractExperimenterMatchCodecTest.java
openflowjava/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/util/EncodeConstants.java
openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/DeserializationFactory.java
openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/action/AbstractActionDeserializer.java
openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/action/OF10EnqueueActionDeserializer.java
openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/action/OF10OutputActionDeserializer.java
openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/action/OF10SetDlDstActionDeserializer.java
openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/action/OF10SetDlSrcActionDeserializer.java
openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/action/OF10SetNwDstActionDeserializer.java
openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/action/OF10SetNwSrcActionDeserializer.java
openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/action/OF10SetNwTosActionDeserializer.java
openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/action/OF10SetTpDstActionDeserializer.java
openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/action/OF10SetTpSrcActionDeserializer.java
openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/action/OF10SetVlanPcpActionDeserializer.java
openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/action/OF10SetVlanVidActionDeserializer.java
openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/action/OF10StripVlanActionDeserializer.java
openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/action/OF13CopyTtlInActionDeserializer.java
openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/action/OF13CopyTtlOutActionDeserializer.java
openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/action/OF13DecMplsTtlActionDeserializer.java
openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/action/OF13DecNwTtlActionDeserializer.java
openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/action/OF13GroupActionDeserializer.java
openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/action/OF13OutputActionDeserializer.java
openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/action/OF13PopMplsActionDeserializer.java
openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/action/OF13PopPbbActionDeserializer.java
openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/action/OF13PopVlanActionDeserializer.java
openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/action/OF13PushMplsActionDeserializer.java
openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/action/OF13PushPbbActionDeserializer.java
openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/action/OF13PushVlanActionDeserializer.java
openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/action/OF13SetFieldActionDeserializer.java
openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/action/OF13SetMplsTtlActionDeserializer.java
openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/action/OF13SetNwTtlActionDeserializer.java
openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/action/OF13SetQueueActionDeserializer.java
openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/factories/ErrorMessageFactory.java
openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/factories/MeterModInputMessageFactory.java
openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/factories/MultipartReplyMessageFactory.java
openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/instruction/ApplyActionsInstructionDeserializer.java
openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/instruction/ClearActionsInstructionDeserializer.java
openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/instruction/GoToTableInstructionDeserializer.java
openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/instruction/MeterInstructionDeserializer.java
openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/instruction/WriteActionsInstructionDeserializer.java
openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/instruction/WriteMetadataInstructionDeserializer.java
openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/match/AbstractOxmMatchEntryDeserializer.java
openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/match/OxmIpv6ExtHdrDeserializer.java
openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/match/OxmIpv6FlabelDeserializer.java
openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/match/OxmMetadataDeserializer.java
openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/match/OxmTunnelIdDeserializer.java
openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/match/OxmVlanVidDeserializer.java
openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/match/ext/OnfOxmTcpFlagsDeserializer.java
openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/OxmArpOpSerializer.java
openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/OxmArpSpaSerializer.java
openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/OxmArpTpaSerializer.java
openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/OxmEthTypeSerializer.java
openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/OxmIcmpv4CodeSerializer.java
openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/OxmIcmpv4TypeSerializer.java
openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/OxmIcmpv6CodeSerializer.java
openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/OxmIcmpv6TypeSerializer.java
openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/OxmInPhyPortSerializer.java
openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/OxmInPortSerializer.java
openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/OxmIpDscpSerializer.java
openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/OxmIpEcnSerializer.java
openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/OxmIpProtoSerializer.java
openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/OxmIpv4DstSerializer.java
openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/OxmIpv4SrcSerializer.java
openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/OxmIpv6ExtHdrSerializer.java
openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/OxmIpv6FlabelSerializer.java
openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/OxmMetadataSerializer.java
openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/OxmMplsBosSerializer.java
openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/OxmMplsLabelSerializer.java
openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/OxmMplsTcSerializer.java
openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/OxmPacketTypeSerializer.java
openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/OxmSctpDstSerializer.java
openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/OxmSctpSrcSerializer.java
openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/OxmTcpDstSerializer.java
openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/OxmTcpSrcSerializer.java
openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/OxmTunnelIdSerializer.java
openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/OxmUdpDstSerializer.java
openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/OxmUdpSrcSerializer.java
openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/OxmVlanPcpSerializer.java
openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/OxmVlanVidSerializer.java
openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/ext/AbstractOxmExperimenterMatchEntrySerializer.java
openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/ext/OnfOxmTcpFlagsSerializer.java
openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/util/CodeKeyMakerFactory.java
openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/util/ListDeserializer.java
openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/util/MatchDeserializer.java
openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/FlowModInputMessageFactoryTest.java
openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/FlowRemovedMessageFactoryTest.java
openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/GroupModInputMessageFactoryTest.java
openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/MultipartReplyMessageFactoryTest.java
openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/MultipartRequestInputFactoryTest.java
openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/PacketInMessageFactoryTest.java
openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/PacketOutInputMessageFactoryTest.java
openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/RoleReplyMessageFactoryTest.java
openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/RoleRequestInputMessageFactoryTest.java
openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/multipart/MultipartRequestTableFeaturesTest.java
openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/OxmArpOpSerializerTest.java
openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/OxmArpSpaSerializerTest.java
openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/OxmArpTpaSerializerTest.java
openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/OxmEthTypeSerializerTest.java
openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/OxmIcmpv4CodeSerializerTest.java
openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/OxmIcmpv4TypeSerializerTest.java
openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/OxmIcmpv6CodeSerializerTest.java
openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/OxmIcmpv6TypeSerializerTest.java
openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/OxmIpDscpSerializerTest.java
openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/OxmIpProtoSerializerTest.java
openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/OxmIpv4DstSerializerTest.java
openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/OxmIpv4SrcSerializerTest.java
openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/OxmIpv6ExtHdrSerializerTest.java
openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/OxmMetadataSerializerTest.java
openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/OxmMplsBosSerializerTest.java
openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/OxmMplsLabelSerializerTest.java
openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/OxmMplsTcSerializerTest.java
openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/OxmPacketTypeSerializerTest.java
openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/OxmSctpDstSerializerTest.java
openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/OxmSctpSrcSerializerTest.java
openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/OxmTcpDstSerializerTest.java
openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/OxmTcpSrcSerializerTest.java
openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/OxmTunnelIdSerializerTest.java
openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/OxmUdpDstSerializerTest.java
openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/OxmUdpSrcSerializerTest.java
openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/OxmVlanPcpSerializerTest.java
openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/OxmVlanVidSerializerTest.java
openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/util/OF13MatchSerializerTest.java
openflowjava/openflowjava-util/src/main/java/org/opendaylight/openflowjava/util/ByteBufUtils.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/deserialization/action/AbstractActionDeserializer.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/deserialization/instruction/AbstractActionInstructionDeserializer.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/deserialization/instruction/AbstractInstructionDeserializer.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/deserialization/instruction/WriteMetadataInstructionDeserializer.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/deserialization/match/AbstractMatchEntryDeserializer.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/deserialization/match/Ipv6ExtHeaderEntryDeserializer.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/deserialization/match/Ipv6FlabelEntryDeserializer.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/deserialization/match/MatchDeserializer.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/deserialization/match/MetadataEntryDeserializer.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/deserialization/match/TunnelIdEntryDeserializer.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/deserialization/match/VlanVidEntryDeserializer.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/deserialization/messages/FlowMessageDeserializer.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/deserialization/messages/MeterMessageDeserializer.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/deserialization/messages/PacketInMessageDeserializer.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/deserialization/messages/PortMessageDeserializer.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/deserialization/multipart/MultipartReplyFlowAggregateStatsDeserializer.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/deserialization/multipart/MultipartReplyFlowStatsDeserializer.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/deserialization/multipart/MultipartReplyFlowTableStatsDeserializer.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/deserialization/multipart/MultipartReplyGroupStatsDeserializer.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/deserialization/multipart/MultipartReplyMeterConfigDeserializer.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/deserialization/multipart/MultipartReplyMeterStatsDeserializer.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/deserialization/multipart/MultipartReplyPortStatsDeserializer.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/deserialization/multipart/MultipartReplyQueueStatsDeserializer.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/deserialization/multipart/MultipartReplyTableFeaturesDeserializer.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/deserialization/multipart/TableFeaturesMatchFieldDeserializer.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/deserialization/util/ActionUtil.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/deserialization/util/InstructionUtil.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/match/AbstractExperimenterMatchEntrySerializer.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/match/AbstractIpv4PolymorphicEntrySerializer.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/match/AbstractIpv4PrefixEntrySerializer.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/match/AbstractUint16EntrySerializer.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/match/AbstractUint32EntrySerializer.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/match/AbstractUint8EntrySerializer.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/match/EthernetTypeEntrySerializer.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/match/InPhyPortEntrySerializer.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/match/InPortEntrySerializer.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/match/IpDscpEntrySerializer.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/match/Ipv6ExtHeaderEntrySerializer.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/match/Ipv6LabelEntrySerializer.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/match/MetadataEntrySerializer.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/match/MplsBosEntrySerializer.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/match/TcpFlagsEntrySerializer.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/match/TunnelIdEntrySerializer.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/match/VlanPcpEntrySerializer.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/match/VlanVidEntrySerializer.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/tablefeatures/matchfield/ArpOpMatchFieldSerializer.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/tablefeatures/matchfield/ArpSpaMatchFieldSerializer.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/tablefeatures/matchfield/ArpTpaMatchFieldSerializer.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/tablefeatures/matchfield/EthTypeMatchFieldSerializer.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/tablefeatures/matchfield/Icmpv4CodeMatchFieldSerializer.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/tablefeatures/matchfield/Icmpv4TypeMatchFieldSerializer.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/tablefeatures/matchfield/Icmpv6CodeMatchFieldSerializer.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/tablefeatures/matchfield/Icmpv6TypeMatchFieldSerializer.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/tablefeatures/matchfield/InPhyPortMatchFieldSerializer.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/tablefeatures/matchfield/InPortMatchFieldSerializer.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/tablefeatures/matchfield/IpDscpMatchFieldSerializer.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/tablefeatures/matchfield/IpEcnMatchFieldSerializer.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/tablefeatures/matchfield/IpProtoMatchFieldSerializer.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/tablefeatures/matchfield/Ipv4DstMatchFieldSerializer.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/tablefeatures/matchfield/Ipv4SrcMatchFieldSerializer.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/tablefeatures/matchfield/Ipv6ExtHdrMatchFieldSerializer.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/tablefeatures/matchfield/Ipv6FlabelMatchFieldSerializer.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/tablefeatures/matchfield/MetadataMatchFieldSerializer.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/tablefeatures/matchfield/MplsBosMatchFieldSerializer.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/tablefeatures/matchfield/MplsLabelMatchFieldSerializer.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/tablefeatures/matchfield/MplsTcMatchFieldSerializer.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/tablefeatures/matchfield/SctpDstMatchFieldSerializer.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/tablefeatures/matchfield/SctpSrcMatchFieldSerializer.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/tablefeatures/matchfield/TcpDstMatchFieldSerializer.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/tablefeatures/matchfield/TcpFlagsMatchFieldSerializer.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/tablefeatures/matchfield/TcpSrcMatchFieldSerializer.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/tablefeatures/matchfield/TunnelIdMatchFieldSerializer.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/tablefeatures/matchfield/UdpDstMatchFieldSerializer.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/tablefeatures/matchfield/UdpSrcMatchFieldSerializer.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/tablefeatures/matchfield/VlanPcpMatchFieldSerializer.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/tablefeatures/matchfield/VlanVidMatchFieldSerializer.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/protocol/deserialization/action/SetFieldActionDeserializerTest.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/protocol/deserialization/instruction/WriteMetadataInstructionDeserializerTest.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/protocol/deserialization/match/ArpOpEntryDeserializerTest.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/protocol/deserialization/match/ArpSourceTransportAddressEntryDeserializerTest.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/protocol/deserialization/match/ArpTargetTransportAddressEntryDeserializerTest.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/protocol/deserialization/match/EthernetTypeEntryDeserializerTest.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/protocol/deserialization/match/Icmpv4CodeEntryDeserializerTest.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/protocol/deserialization/match/Icmpv4TypeEntryDeserializerTest.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/protocol/deserialization/match/Icmpv6CodeEntryDeserializerTest.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/protocol/deserialization/match/Icmpv6TypeEntryDeserializerTest.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/protocol/deserialization/match/InPhyPortEntryDeserializerTest.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/protocol/deserialization/match/InPortEntryDeserializerTest.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/protocol/deserialization/match/IpDscpEntryDeserializerTest.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/protocol/deserialization/match/IpEcnEntryDeserializerTest.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/protocol/deserialization/match/IpProtoEntryDeserializerTest.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/protocol/deserialization/match/Ipv6ExtHeaderEntryDeserializerTest.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/protocol/deserialization/match/Ipv6FlabelEntryDeserializerTest.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/protocol/deserialization/match/MetadataEntryDeserializerTest.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/protocol/deserialization/match/MplsBosEntryDeserializerTest.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/protocol/deserialization/match/MplsLabelEntryDeserializerTest.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/protocol/deserialization/match/MplsTcEntryDeserializerTest.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/protocol/deserialization/match/PacketTypeEntryDeserializerTest.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/protocol/deserialization/match/SctpDestinationPortEntryDeserializerTest.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/protocol/deserialization/match/SctpSourcePortEntryDeserializerTest.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/protocol/deserialization/match/TcpDestinationPortEntryDeserializerTest.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/protocol/deserialization/match/TcpFlagsEntryDeserializerTest.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/protocol/deserialization/match/TcpSourcePortEntryDeserializerTest.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/protocol/deserialization/match/TunnelIdEntryDeserializerTest.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/protocol/deserialization/match/UdpDestinationPortEntryDeserializerTest.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/protocol/deserialization/match/UdpSourcePortEntryDeserializerTest.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/protocol/deserialization/match/VlanPcpEntryDeserializerTest.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/protocol/deserialization/match/VlanVidEntryDeserializerTest.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/protocol/deserialization/messages/FlowMessageDeserializerTest.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/protocol/deserialization/messages/PacketInMessageDeserializerTest.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/protocol/deserialization/multipart/MultipartReplyFlowStatsDeserializerTest.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/protocol/deserialization/multipart/MultipartReplyMessageDeserializerTest.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/protocol/serialization/actions/AbstractSetFieldActionSerializerTest.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/protocol/serialization/instructions/ApplyActionsInstructionSerializerTest.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/protocol/serialization/instructions/WriteActionsInstructionSerializerTest.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/protocol/serialization/match/AbstractExperimenterMatchEntrySerializerTest.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/protocol/serialization/match/AbstractMatchEntrySerializerTest.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/protocol/serialization/match/ArpOpEntrySerializerTest.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/protocol/serialization/match/ArpSourceTransportAddressEntrySerializerTest.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/protocol/serialization/match/ArpTargetTransportAddressEntrySerializerTest.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/protocol/serialization/match/EthernetTypeEntrySerializerTest.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/protocol/serialization/match/Icmpv4CodeEntrySerializerTest.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/protocol/serialization/match/Icmpv4TypeEntrySerializerTest.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/protocol/serialization/match/Icmpv6CodeEntrySerializerTest.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/protocol/serialization/match/Icmpv6TypeEntrySerializerTest.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/protocol/serialization/match/InPhyPortEntrySerializerTest.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/protocol/serialization/match/InPortEntrySerializerTest.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/protocol/serialization/match/IpDscpEntrySerializerTest.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/protocol/serialization/match/IpEcnEntrySerializerTest.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/protocol/serialization/match/IpProtoEntrySerializerTest.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/protocol/serialization/match/Ipv4ArbitraryBitMaskDestinationEntrySerializerTest.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/protocol/serialization/match/Ipv4ArbitraryBitMaskSourceEntrySerializerTest.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/protocol/serialization/match/Ipv4DestinationEntrySerializerTest.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/protocol/serialization/match/Ipv4SourceEntrySerializerTest.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/protocol/serialization/match/Ipv6ExtHeaderEntrySerializerTest.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/protocol/serialization/match/Ipv6LabelEntrySerializerTest.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/protocol/serialization/match/MetadataEntrySerializerTest.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/protocol/serialization/match/MplsBosEntrySerializerTest.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/protocol/serialization/match/MplsLabelEntrySerializerTest.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/protocol/serialization/match/MplsTcEntrySerializerTest.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/protocol/serialization/match/PacketTypeEntrySerializerTest.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/protocol/serialization/match/SctpDestinationPortEntrySerializerTest.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/protocol/serialization/match/SctpSourcePortEntrySerializerTest.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/protocol/serialization/match/TcpDestinationPortEntrySerializerTest.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/protocol/serialization/match/TcpFlagsEntrySerializerTest.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/protocol/serialization/match/TcpSourcePortEntrySerializerTest.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/protocol/serialization/match/TunnelIdEntrySerializerTest.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/protocol/serialization/match/TunnelIpv4DestinationEntrySerializerTest.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/protocol/serialization/match/TunnelIpv4SourceEntrySerializerTest.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/protocol/serialization/match/UdpDestinationPortEntrySerializerTest.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/protocol/serialization/match/UdpSourcePortEntrySerializerTest.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/protocol/serialization/match/VlanPcpEntrySerializerTest.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/protocol/serialization/match/VlanVidEntrySerializerTest.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/protocol/serialization/messages/FlowMessageSerializerTest.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/protocol/serialization/messages/GroupMessageSerializerTest.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/MultipartRequestFlowAggregateStatsSerializerTest.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/MultipartRequestFlowStatsSerializerTest.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/MultipartRequestTableFeaturesSerializerTest.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/tablefeatures/ApplyActionsMissTablePropertySerializerTest.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/tablefeatures/ApplyActionsTablePropertySerializerTest.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/tablefeatures/ApplySetfieldMissTablePropertySerializerTest.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/tablefeatures/ApplySetfieldTablePropertySerializerTest.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/tablefeatures/InstructionsMissTablePropertySerializerTest.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/tablefeatures/InstructionsTablePropertySerializerTest.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/tablefeatures/MatchTablePropertySerializerTest.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/tablefeatures/WildcardsTablePropertySerializerTest.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/tablefeatures/WriteActionsMissTablePropertySerializerTest.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/tablefeatures/WriteActionsTablePropertySerializerTest.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/tablefeatures/WriteSetfieldMissTablePropertySerializerTest.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/tablefeatures/WriteSetfieldTablePropertySerializerTest.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/tablefeatures/matchfield/MatchFieldSerializerTest.java
openflowplugin/src/test/java/org/opendaylight/openflowplugin/openflow/md/core/sal/convertor/PacketOutConvertorTest.java

index 0afd30a9411e5e3d0b8e75737f9963840db0e24a..8a98549a725da93893e402721f3667f66354ecc2 100644 (file)
@@ -5,7 +5,6 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowjava.eric.codec.match;
 
 import io.netty.buffer.ByteBuf;
@@ -13,7 +12,6 @@ import org.opendaylight.openflowjava.protocol.api.extensibility.HeaderDeserializ
 import org.opendaylight.openflowjava.protocol.api.extensibility.HeaderSerializer;
 import org.opendaylight.openflowjava.protocol.api.extensibility.OFDeserializer;
 import org.opendaylight.openflowjava.protocol.api.extensibility.OFSerializer;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.MatchField;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.OxmClassBase;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntry;
@@ -32,12 +30,12 @@ public abstract class AbstractMatchCodec implements
         MatchEntryBuilder builder = new MatchEntryBuilder();
         builder.setOxmClass(getOxmClass());
         // skip oxm_class - provided
-        message.skipBytes(EncodeConstants.SIZE_OF_SHORT_IN_BYTES);
+        message.skipBytes(Short.BYTES);
         builder.setOxmMatchField(getEricField());
         boolean hasMask = (message.readUnsignedByte() & 1) != 0;
         builder.setHasMask(hasMask);
         // skip experimenter class, match length and experimenter id - not needed
-        message.skipBytes(EncodeConstants.SIZE_OF_BYTE_IN_BYTES);
+        message.skipBytes(Byte.BYTES);
         return builder;
     }
 
@@ -110,4 +108,4 @@ public abstract class AbstractMatchCodec implements
      * Returns the oxm_class class.
      */
     public abstract Class<? extends OxmClassBase> getOxmClass();
-}
\ No newline at end of file
+}
index df2a588e4010357c16dc61bc4ee038b3fe276f61..0ef4953d16442d86699399ba03d5aa3a845152ab 100644 (file)
@@ -40,13 +40,13 @@ public abstract class AbstractActionCodec implements OFSerializer<Action>, OFDes
 
     protected static final ActionBuilder deserializeHeader(final ByteBuf message) {
         // size of experimenter type
-        message.skipBytes(EncodeConstants.SIZE_OF_SHORT_IN_BYTES);
+        message.skipBytes(Short.BYTES);
         // size of length
-        message.skipBytes(EncodeConstants.SIZE_OF_SHORT_IN_BYTES);
+        message.skipBytes(Short.BYTES);
         // vendor id
-        message.skipBytes(EncodeConstants.SIZE_OF_INT_IN_BYTES);
+        message.skipBytes(Integer.BYTES);
         // subtype
-        message.skipBytes(EncodeConstants.SIZE_OF_SHORT_IN_BYTES);
+        message.skipBytes(Short.BYTES);
         ActionBuilder actionBuilder = new ActionBuilder();
         actionBuilder.setExperimenterId(getExperimenterId());
         return actionBuilder;
@@ -69,7 +69,7 @@ public abstract class AbstractActionCodec implements OFSerializer<Action>, OFDes
     protected static final void writePaddingAndSetLength(ByteBuf outBuffer, int startIndex) {
         int nonPaddedSize = outBuffer.writerIndex() - startIndex;
         outBuffer.writeZero(getPaddingRemainder(nonPaddedSize));
-        outBuffer.setShort(startIndex + EncodeConstants.SIZE_OF_SHORT_IN_BYTES, outBuffer.writerIndex() - startIndex);
+        outBuffer.setShort(startIndex + Short.BYTES, outBuffer.writerIndex() - startIndex);
     }
 
     protected static void writeNxmHeader(final Uint64 value, final ByteBuf outBuffer) {
@@ -82,9 +82,7 @@ public abstract class AbstractActionCodec implements OFSerializer<Action>, OFDes
 
     protected static BigInteger readNxmHeader(final ByteBuf message) {
         int value = message.getUnsignedShort(message.readerIndex());
-        byte[] bytes = new byte[value == EncodeConstants.EXPERIMENTER_VALUE
-                ? EncodeConstants.SIZE_OF_LONG_IN_BYTES
-                : EncodeConstants.SIZE_OF_INT_IN_BYTES];
+        byte[] bytes = new byte[value == EncodeConstants.EXPERIMENTER_VALUE ? Long.BYTES : Integer.BYTES];
         message.readBytes(bytes);
         return new BigInteger(1, bytes);
     }
index 5aa922d409d45e9d1766dc30044855051644169f..5bc192a64cda82480062677a54a89c3201767570 100644 (file)
@@ -46,9 +46,9 @@ public class ActionDeserializer implements OFDeserializer<Action>, DeserializerR
     public Action deserialize(ByteBuf message) {
         final int startPosition = message.readerIndex();
         // size of experimenter type
-        message.skipBytes(EncodeConstants.SIZE_OF_SHORT_IN_BYTES);
+        message.skipBytes(Short.BYTES);
         // size of length
-        message.skipBytes(EncodeConstants.SIZE_OF_SHORT_IN_BYTES);
+        message.skipBytes(Short.BYTES);
         long experimenterId = message.readUnsignedInt();
         if (NiciraConstants.NX_VENDOR_ID.toJava() != experimenterId) {
             throw new IllegalStateException("Experimenter ID is not Nicira vendor id but is " + experimenterId);
index 07735f5661c839e28a8bee985a731ce0676bf88e..1c42a0aa8a2734dfd11e847ef534f42b80937274 100644 (file)
@@ -260,7 +260,7 @@ public class ConntrackCodec extends AbstractActionCodec {
                 ctActionsBuilder.setOfpactActions(caseBuilder.build());
                 ctActionsList.add(ctActionsBuilder.build());
                 // padding
-                message.skipBytes(EncodeConstants.SIZE_OF_INT_IN_BYTES);
+                message.skipBytes(Integer.BYTES);
             }
         }
 
@@ -269,18 +269,18 @@ public class ConntrackCodec extends AbstractActionCodec {
 
     private static short deserializeCtHeaderWithoutSubtype(final ByteBuf message) {
         // size of experimenter type / size of set field code (in case of ct_mark)
-        message.skipBytes(EncodeConstants.SIZE_OF_SHORT_IN_BYTES);
+        message.skipBytes(Short.BYTES);
         // size of length
         short length = message.readShort();
         // vendor id / 00 01 d6 04 (in case of ct_mark)
-        message.skipBytes(EncodeConstants.SIZE_OF_INT_IN_BYTES);
+        message.skipBytes(Integer.BYTES);
         return length;
     }
 
     private static short deserializeCtHeader(final ByteBuf message) {
         short length = deserializeCtHeaderWithoutSubtype(message);
         // subtype
-        message.skipBytes(EncodeConstants.SIZE_OF_SHORT_IN_BYTES);
+        message.skipBytes(Short.BYTES);
         return length;
     }
 }
index cc2801b970ca0f14595a6ad16bedc7776e663197..bbb0241105fe4965da2daa1de8ddeb4dea6fb7f3 100644 (file)
@@ -35,7 +35,7 @@ public class EncapCodec extends AbstractActionCodec {
     public Action deserialize(ByteBuf message) {
         final ActionBuilder actionBuilder = deserializeHeader(message);
         // skip header size, not used
-        message.skipBytes(EncodeConstants.SIZE_OF_SHORT_IN_BYTES);
+        message.skipBytes(Short.BYTES);
         NxActionEncap nxActionEncap = new NxActionEncapBuilder().setPacketType(readUint32(message)).build();
         ActionEncap actionEncap = new ActionEncapBuilder().setNxActionEncap(nxActionEncap).build();
         actionBuilder.setActionChoice(actionEncap);
index 65e019e8dd4b9aae05480fa3e12f95e249bb49aa..ccf66aedc58018c1e10893fc706b7f7e1f6f46a6 100644 (file)
@@ -15,7 +15,6 @@ import io.netty.buffer.ByteBuf;
 import java.math.BigInteger;
 import java.util.ArrayList;
 import java.util.List;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.action.container.action.choice.ActionLearn;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.flow.mod.spec.flow.mod.spec.FlowModAddMatchFromFieldCase;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.flow.mod.spec.flow.mod.spec.FlowModAddMatchFromFieldCaseBuilder;
@@ -44,7 +43,6 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 public final class LearnCodecUtil {
-
     private static final Logger LOG = LoggerFactory.getLogger(LearnCodecUtil.class);
     public static final int HEADER_LENGTH = 32;
     private static final short SRC_MASK = 0x2000;
@@ -63,13 +61,13 @@ public final class LearnCodecUtil {
 
     static short deserializeHeader(ByteBuf message) {
         // size of experimenter type
-        message.skipBytes(EncodeConstants.SIZE_OF_SHORT_IN_BYTES);
+        message.skipBytes(Short.BYTES);
         // size of length
         short messageLength = message.readShort();
         // vendor id
-        message.skipBytes(EncodeConstants.SIZE_OF_INT_IN_BYTES);
+        message.skipBytes(Integer.BYTES);
         // subtype
-        message.skipBytes(EncodeConstants.SIZE_OF_SHORT_IN_BYTES);
+        message.skipBytes(Short.BYTES);
         return messageLength;
     }
 
@@ -226,7 +224,7 @@ public final class LearnCodecUtil {
 
     private static FlowMods readFlowMod(ByteBuf message) {
         short header = message.readShort();
-        length -= EncodeConstants.SIZE_OF_SHORT_IN_BYTES;
+        length -= Short.BYTES;
         if (header == 0) {
             return null;
         }
@@ -261,7 +259,7 @@ public final class LearnCodecUtil {
         builder.setDstField(readUint32(message));
         builder.setDstOfs((int) message.readShort());
         builder.setFlowModNumBits((int) numBits);
-        length -= FROM_FIELD_LENGTH - EncodeConstants.SIZE_OF_SHORT_IN_BYTES;
+        length -= FROM_FIELD_LENGTH - Short.BYTES;
 
         FlowModsBuilder flowModsBuilder = new FlowModsBuilder();
         FlowModAddMatchFromFieldCaseBuilder caseBuilder = new FlowModAddMatchFromFieldCaseBuilder();
@@ -276,7 +274,7 @@ public final class LearnCodecUtil {
         builder.setSrcField(readUint32(message));
         builder.setSrcOfs((int) message.readShort());
         builder.setFlowModNumBits((int) numBits);
-        length -= FROM_VALUE_LENGTH - EncodeConstants.SIZE_OF_SHORT_IN_BYTES;
+        length -= FROM_VALUE_LENGTH - Short.BYTES;
 
         FlowModsBuilder flowModsBuilder = new FlowModsBuilder();
         FlowModAddMatchFromValueCaseBuilder caseBuilder = new FlowModAddMatchFromValueCaseBuilder();
@@ -292,7 +290,7 @@ public final class LearnCodecUtil {
         builder.setDstField(readUint32(message));
         builder.setDstOfs((int) message.readShort());
         builder.setFlowModNumBits((int) numBits);
-        length -= FROM_FIELD_LENGTH - EncodeConstants.SIZE_OF_SHORT_IN_BYTES;
+        length -= FROM_FIELD_LENGTH - Short.BYTES;
 
         FlowModsBuilder flowModsBuilder = new FlowModsBuilder();
         FlowModCopyFieldIntoFieldCaseBuilder caseBuilder = new FlowModCopyFieldIntoFieldCaseBuilder();
@@ -307,7 +305,7 @@ public final class LearnCodecUtil {
         builder.setDstField(readUint32(message));
         builder.setDstOfs((int) message.readShort());
         builder.setFlowModNumBits((int) numBits);
-        length -= FROM_VALUE_LENGTH - EncodeConstants.SIZE_OF_SHORT_IN_BYTES;
+        length -= FROM_VALUE_LENGTH - Short.BYTES;
 
         FlowModsBuilder flowModsBuilder = new FlowModsBuilder();
         FlowModCopyValueIntoFieldCaseBuilder caseBuilder = new FlowModCopyValueIntoFieldCaseBuilder();
@@ -321,7 +319,7 @@ public final class LearnCodecUtil {
         builder.setSrcField(readUint32(message));
         builder.setSrcOfs((int) message.readShort());
         builder.setFlowModNumBits((int) numBits);
-        length -= TO_PORT_LENGTH - EncodeConstants.SIZE_OF_SHORT_IN_BYTES;
+        length -= TO_PORT_LENGTH - Short.BYTES;
 
         FlowModsBuilder flowModsBuilder = new FlowModsBuilder();
         FlowModOutputToPortCaseBuilder caseBuilder = new FlowModOutputToPortCaseBuilder();
index 3cb7956b36fcf07acf484b46335a400695ecb620..41537658c4387ec04a97ca4a7609fe437c962d70 100644 (file)
@@ -55,15 +55,13 @@ public class RegLoad2Codec
         ActionBuilder actionBuilder = deserializeHeader(message);
 
         int oxmClass = message.getUnsignedShort(message.readerIndex());
-        int oxmField = message.getUnsignedByte(message.readerIndex() + EncodeConstants.SIZE_OF_SHORT_IN_BYTES) >>> 1;
+        int oxmField = message.getUnsignedByte(message.readerIndex() + Short.BYTES) >>> 1;
         MatchEntryDeserializerKey key = new MatchEntryDeserializerKey(
                 EncodeConstants.OF13_VERSION_ID,
                 oxmClass,
                 oxmField);
         if (oxmClass == EncodeConstants.EXPERIMENTER_VALUE) {
-            long expId = message.getUnsignedInt(message.readerIndex()
-                    + EncodeConstants.SIZE_OF_SHORT_IN_BYTES
-                    + EncodeConstants.SIZE_OF_BYTE_IN_BYTES * 2);
+            long expId = message.getUnsignedInt(message.readerIndex() + Short.BYTES + Byte.BYTES * 2);
             key.setExperimenterId(Uint32.valueOf(expId));
         }
         OFDeserializer<MatchEntry> matchDeserializer = deserializerRegistry.getDeserializer(key);
index 05d16c234f5272665e654f2de9e6de83d00d11a3..35e44e53e1ace80de45de8ce9eb5e055363a521a 100644 (file)
@@ -5,14 +5,12 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowjava.nx.codec.match;
 
 import io.netty.buffer.ByteBuf;
 import org.eclipse.jdt.annotation.NonNull;
 import org.opendaylight.openflowjava.protocol.api.keys.MatchEntryDeserializerKey;
 import org.opendaylight.openflowjava.protocol.api.keys.MatchEntrySerializerKey;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.oxm.container.match.entry.value.ExperimenterIdCase;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.oxm.container.match.entry.value.ExperimenterIdCaseBuilder;
@@ -65,7 +63,7 @@ public abstract class AbstractExperimenterMatchCodec extends AbstractMatchCodec
         final MatchEntryBuilder matchEntryBuilder = deserializeHeaderToBuilder(message);
 
         // skip experimenter Id
-        message.skipBytes(EncodeConstants.SIZE_OF_INT_IN_BYTES);
+        message.skipBytes(Integer.BYTES);
 
         ExperimenterIdCaseBuilder expCaseBuilder = new ExperimenterIdCaseBuilder();
         ExperimenterBuilder expBuilder = new ExperimenterBuilder();
@@ -100,7 +98,7 @@ public abstract class AbstractExperimenterMatchCodec extends AbstractMatchCodec
         return new NxmHeader(
                 getNxmFieldCode(),
                 hasMask,
-                EncodeConstants.SIZE_OF_INT_IN_BYTES + (hasMask ? getValueLength() * 2 : getValueLength()),
+                Integer.BYTES + (hasMask ? getValueLength() * 2 : getValueLength()),
                 getExperimenterId().longValue());
     }
 
index ea4ae77a267ce2e0d63b8bdd8a59681c7fba9162..21cd1c0bf918da1defbdfb95eabdf50644e175d4 100644 (file)
@@ -5,7 +5,6 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowjava.nx.codec.match;
 
 import io.netty.buffer.ByteBuf;
@@ -13,7 +12,6 @@ import org.opendaylight.openflowjava.protocol.api.extensibility.HeaderDeserializ
 import org.opendaylight.openflowjava.protocol.api.extensibility.HeaderSerializer;
 import org.opendaylight.openflowjava.protocol.api.extensibility.OFDeserializer;
 import org.opendaylight.openflowjava.protocol.api.extensibility.OFSerializer;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.MatchField;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.OxmClassBase;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntry;
@@ -32,12 +30,12 @@ public abstract class AbstractMatchCodec implements
         MatchEntryBuilder builder = new MatchEntryBuilder();
         builder.setOxmClass(getOxmClass());
         // skip oxm_class - provided
-        message.skipBytes(EncodeConstants.SIZE_OF_SHORT_IN_BYTES);
+        message.skipBytes(Short.BYTES);
         builder.setOxmMatchField(getNxmField());
         boolean hasMask = (message.readUnsignedByte() & 1) != 0;
         builder.setHasMask(hasMask);
         // skip match entry length - not needed
-        message.skipBytes(EncodeConstants.SIZE_OF_BYTE_IN_BYTES);
+        message.skipBytes(Byte.BYTES);
         return builder;
     }
 
index ad068b2f8b928191a9732bf3ba15af6b453489a6..e66a09a6eb8ae61ac1c2b3d3074ec48aaa82e6fe 100644 (file)
@@ -11,16 +11,12 @@ import static org.opendaylight.yangtools.yang.common.netty.ByteBufUtils.readUint
 
 import io.netty.buffer.ByteBuf;
 import org.opendaylight.openflowjava.nx.api.NiciraConstants;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.oxm.container.match.entry.value.experimenter.id._case.NxExpMatchEntryValue;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.oxm.container.match.entry.value.experimenter.id._case.nx.exp.match.entry.value.NshcCaseValue;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.oxm.container.match.entry.value.experimenter.id._case.nx.exp.match.entry.value.NshcCaseValueBuilder;
 import org.opendaylight.yangtools.yang.common.Uint32;
 
 public abstract class AbstractNshcCodec extends AbstractExperimenterMatchCodec {
-
-    private static final int VALUE_LENGTH = EncodeConstants.SIZE_OF_INT_IN_BYTES;
-
     @Override
     protected void serializeValue(NxExpMatchEntryValue value, boolean hasMask, ByteBuf outBuffer) {
         NshcCaseValue nshcCaseValue = (NshcCaseValue) value;
@@ -44,6 +40,6 @@ public abstract class AbstractNshcCodec extends AbstractExperimenterMatchCodec {
 
     @Override
     public int getValueLength() {
-        return VALUE_LENGTH;
+        return Integer.BYTES;
     }
 }
index 7fb4772b41e6944434c1c95b4ea7b6de4da66099..c7b5f1b999a4c8b1d3fba26de64aae2b56bb30aa 100644 (file)
@@ -28,7 +28,7 @@ import org.opendaylight.yangtools.yang.common.Uint8;
 
 public class NshFlagsCodec extends AbstractExperimenterMatchCodec {
 
-    private static final int VALUE_LENGTH = EncodeConstants.SIZE_OF_BYTE_IN_BYTES;
+    private static final int VALUE_LENGTH = Byte.BYTES;
     private static final int NXM_FIELD_CODE = 1;
     public static final MatchEntrySerializerKey<ExperimenterClass, NxmNxNshFlags> SERIALIZER_KEY =
             createSerializerKey(
index 1d0594deb96bb2738830859e656b578b261988b6..028b3ef53d56ae10acee34015eb9d10fb11f4e5c 100644 (file)
@@ -26,7 +26,7 @@ import org.opendaylight.yangtools.yang.common.Uint32;
 
 public class NshMdtypeCodec extends AbstractExperimenterMatchCodec {
 
-    private static final int VALUE_LENGTH = EncodeConstants.SIZE_OF_BYTE_IN_BYTES;
+    private static final int VALUE_LENGTH = Byte.BYTES;
     private static final int NXM_FIELD_CODE = 2;
     public static final MatchEntrySerializerKey<ExperimenterClass, NxmNxNshMdtype> SERIALIZER_KEY =
             createSerializerKey(
index e7ce6ca1a3a025185689aab67580c26e83f461f7..2384a2b41736376c529a920c498fe3f4da60c9a7 100644 (file)
@@ -26,7 +26,7 @@ import org.opendaylight.yangtools.yang.common.Uint32;
 
 public class NshNpCodec extends AbstractExperimenterMatchCodec {
 
-    private static final int VALUE_LENGTH = EncodeConstants.SIZE_OF_BYTE_IN_BYTES;
+    private static final int VALUE_LENGTH = Byte.BYTES;
     private static final int NXM_FIELD_CODE = 3;
     public static final MatchEntrySerializerKey<ExperimenterClass, NxmNxNshNp> SERIALIZER_KEY =
             createSerializerKey(
index 749fa38a25206183a74303c0e7461d5a343df667..aaf006f8c4d190f3ed3f796f8d80b07ff2c14ce1 100644 (file)
@@ -24,7 +24,7 @@ import org.opendaylight.yangtools.yang.common.Uint32;
 
 public class NshTtlCodec extends AbstractExperimenterMatchCodec {
 
-    private static final int VALUE_LENGTH = EncodeConstants.SIZE_OF_BYTE_IN_BYTES;
+    private static final int VALUE_LENGTH = Byte.BYTES;
     private static final int NXM_FIELD_CODE = 10;
     public static final MatchEntrySerializerKey<ExperimenterClass, NxmNxNshTtl> SERIALIZER_KEY =
             createSerializerKey(
index de4393c2bd863f666f2491bd0af8d112d48851e3..f708df8a5acb35f8df65b5ed1c500861e821016c 100644 (file)
@@ -27,7 +27,7 @@ import org.opendaylight.yangtools.yang.common.Uint8;
 
 public class NsiCodec extends AbstractExperimenterMatchCodec {
 
-    private static final int VALUE_LENGTH = EncodeConstants.SIZE_OF_BYTE_IN_BYTES;
+    private static final int VALUE_LENGTH = Byte.BYTES;
     private static final int NXM_FIELD_CODE = 5;
     public static final MatchEntrySerializerKey<ExperimenterClass, NxmNxNsi> SERIALIZER_KEY =
             createSerializerKey(
index 759dc4ad55ff811fde1e8c09c6d8360ac732d0bb..209ad306b0cd9a579aac876af9f827ab2dae53e5 100644 (file)
@@ -26,7 +26,7 @@ import org.opendaylight.yangtools.yang.common.Uint32;
 
 public class NspCodec extends AbstractExperimenterMatchCodec {
 
-    private static final int VALUE_LENGTH = EncodeConstants.SIZE_OF_INT_IN_BYTES;
+    private static final int VALUE_LENGTH = Integer.BYTES;
     private static final int NXM_FIELD_CODE = 4;
     public static final MatchEntrySerializerKey<ExperimenterClass, NxmNxNsp> SERIALIZER_KEY =
             createSerializerKey(
index 28e1a6104a67ee7c1c55d9e5cc217bbe557fff5d..c1eda2b10cb7d0ed285609f8af06113bf9cfa4b2 100644 (file)
@@ -92,7 +92,7 @@ public class AbstractExperimenterMatchCodecTest {
 
         assertEquals(EncodeConstants.EXPERIMENTER_VALUE, buffer.readUnsignedShort());
         assertEquals(FIELD_CODE << 1, buffer.readUnsignedByte());
-        assertEquals(EncodeConstants.SIZE_OF_INT_IN_BYTES + VALUE_LENGTH, buffer.readUnsignedByte());
+        assertEquals(Integer.BYTES + VALUE_LENGTH, buffer.readUnsignedByte());
         assertEquals(EXPERIMENTER_ID.longValue(), buffer.readUnsignedInt());
         assertFalse(buffer.isReadable());
         verify(testCodec).serializeValue(null, false, buffer);
@@ -106,7 +106,7 @@ public class AbstractExperimenterMatchCodecTest {
 
         assertEquals(EncodeConstants.EXPERIMENTER_VALUE, buffer.readUnsignedShort());
         assertEquals(FIELD_CODE << 1 | 1, buffer.readUnsignedByte());
-        assertEquals(EncodeConstants.SIZE_OF_INT_IN_BYTES + VALUE_LENGTH * 2, buffer.readUnsignedByte());
+        assertEquals(Integer.BYTES + VALUE_LENGTH * 2, buffer.readUnsignedByte());
         assertEquals(EXPERIMENTER_ID.longValue(), buffer.readUnsignedInt());
         assertFalse(buffer.isReadable());
         verify(testCodec).serializeValue(null, true, buffer);
@@ -158,7 +158,7 @@ public class AbstractExperimenterMatchCodecTest {
 
     static void writeBuffer(ByteBuf message, boolean hasMask) {
         int fieldMask = FIELD_CODE << 1;
-        int length = EncodeConstants.SIZE_OF_INT_IN_BYTES + VALUE_LENGTH;
+        int length = Integer.BYTES + VALUE_LENGTH;
         if (hasMask) {
             fieldMask |= 1;
             length += VALUE_LENGTH;
index a4662c469f4677a1e28f03420bb30f018f448470..f91e479e7d29fdd88894020b6b666ef320a0a6cd 100644 (file)
@@ -72,18 +72,6 @@ public interface EncodeConstants {
     /** Length of ipv6 address in bytes. */
     byte SIZE_OF_IPV6_ADDRESS_IN_BYTES = 8 * Short.SIZE / Byte.SIZE;
 
-    /** Length of long in bytes. */
-    byte SIZE_OF_LONG_IN_BYTES = Long.SIZE / Byte.SIZE;
-
-    /** Length of int in bytes. */
-    byte SIZE_OF_INT_IN_BYTES = Integer.SIZE / Byte.SIZE;
-
-    /** Length of short in bytes. */
-    byte SIZE_OF_SHORT_IN_BYTES = Short.SIZE / Byte.SIZE;
-
-    /** Length of byte in bytes. */
-    byte SIZE_OF_BYTE_IN_BYTES = Byte.SIZE / Byte.SIZE;
-
     /** Length of 3 bytes. */
     byte SIZE_OF_3_BYTES = 3;
 
index 2f03a1a462534cbc4b4602947d30a1b5ffa8e2b1..debbaf645eb31cb591019510507d1796e3f7c0bd 100644 (file)
@@ -5,7 +5,6 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowjava.protocol.impl.deserialization;
 
 import io.netty.buffer.ByteBuf;
@@ -15,7 +14,6 @@ import org.opendaylight.openflowjava.protocol.api.extensibility.DeserializerRegi
 import org.opendaylight.openflowjava.protocol.api.extensibility.OFDeserializer;
 import org.opendaylight.openflowjava.protocol.api.keys.MessageCodeKey;
 import org.opendaylight.openflowjava.protocol.api.keys.TypeToClassKey;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.yangtools.yang.binding.DataObject;
 
 /**
@@ -26,7 +24,6 @@ import org.opendaylight.yangtools.yang.binding.DataObject;
  * @author giuseppex.petralia@intel.com
  */
 public class DeserializationFactory {
-
     private final Map<TypeToClassKey, Class<?>> messageClassMap = new ConcurrentHashMap<>();
     private final DeserializerRegistry registry;
 
@@ -51,7 +48,7 @@ public class DeserializationFactory {
         DataObject dataObject = null;
         int type = rawMessage.readUnsignedByte();
         Class<?> clazz = messageClassMap.get(new TypeToClassKey(version, type));
-        rawMessage.skipBytes(EncodeConstants.SIZE_OF_SHORT_IN_BYTES);
+        rawMessage.skipBytes(Short.BYTES);
         OFDeserializer<DataObject> deserializer = registry.getDeserializer(new MessageCodeKey(version, type, clazz));
         dataObject = deserializer.deserialize(rawMessage);
         return dataObject;
index 3896c9ff7044ab37db85c300662d2ce520b2d4cf..dcf68a2531f3e7a228e9848ae3764ad5ae3e2ef9 100644 (file)
@@ -5,13 +5,11 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowjava.protocol.impl.deserialization.action;
 
 import io.netty.buffer.ByteBuf;
 import org.opendaylight.openflowjava.protocol.api.extensibility.HeaderDeserializer;
 import org.opendaylight.openflowjava.protocol.api.extensibility.OFDeserializer;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.ActionChoice;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.actions.grouping.Action;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.actions.grouping.ActionBuilder;
@@ -23,15 +21,13 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev1
  */
 public abstract class AbstractActionDeserializer implements OFDeserializer<Action>,
         HeaderDeserializer<Action> {
-
     @Override
     public Action deserializeHeader(ByteBuf input) {
         ActionBuilder actionBuilder = new ActionBuilder();
-        input.skipBytes(2 * EncodeConstants.SIZE_OF_SHORT_IN_BYTES);
+        input.skipBytes(2 * Short.BYTES);
         actionBuilder.setActionChoice(getType());
         return actionBuilder.build();
     }
 
     protected abstract ActionChoice getType();
-
 }
index 969cff2f4d15809b5167475547d40e14d22fbf85..cd641c3dcd205defe4f71559d3dbf1aa0951033e 100644 (file)
@@ -11,7 +11,6 @@ import static org.opendaylight.yangtools.yang.common.netty.ByteBufUtils.readUint
 import static org.opendaylight.yangtools.yang.common.netty.ByteBufUtils.readUint32;
 
 import io.netty.buffer.ByteBuf;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.impl.util.ActionConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.ActionChoice;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.EnqueueCaseBuilder;
@@ -30,7 +29,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev13
 public class OF10EnqueueActionDeserializer extends AbstractActionDeserializer {
     @Override
     public Action deserialize(ByteBuf input) {
-        input.skipBytes(2 * EncodeConstants.SIZE_OF_SHORT_IN_BYTES);
+        input.skipBytes(2 * Short.BYTES);
         EnqueueActionBuilder actionBuilder = new EnqueueActionBuilder();
         actionBuilder.setPort(new PortNumber(readUint16(input).toUint32()));
         input.skipBytes(ActionConstants.PADDING_IN_ENQUEUE_ACTION);
index 81e764779652674d0a46fc80eb19ced74b6f76de..48c19be2e7b8a46637c953de127258a33bf3e762 100644 (file)
@@ -10,7 +10,6 @@ package org.opendaylight.openflowjava.protocol.impl.deserialization.action;
 import static org.opendaylight.yangtools.yang.common.netty.ByteBufUtils.readUint16;
 
 import io.netty.buffer.ByteBuf;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.ActionChoice;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.OutputActionCaseBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.output.action._case.OutputActionBuilder;
@@ -27,7 +26,7 @@ public class OF10OutputActionDeserializer extends AbstractActionDeserializer {
     @Override
     public Action deserialize(ByteBuf input) {
         final ActionBuilder builder = new ActionBuilder();
-        input.skipBytes(2 * EncodeConstants.SIZE_OF_SHORT_IN_BYTES);
+        input.skipBytes(2 * Short.BYTES);
         OutputActionCaseBuilder caseBuilder = new OutputActionCaseBuilder();
         OutputActionBuilder actionBuilder = new OutputActionBuilder();
         actionBuilder.setPort(new PortNumber(readUint16(input).toUint32()));
index fd797bbb367b1dcf2a7bf63041bbbc12ee111edd..c9f2abc246461a2858cf87d67d09f94a41b3c55b 100644 (file)
@@ -5,11 +5,9 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowjava.protocol.impl.deserialization.action;
 
 import io.netty.buffer.ByteBuf;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.impl.util.ActionConstants;
 import org.opendaylight.openflowjava.util.ByteBufUtils;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.ActionChoice;
@@ -24,11 +22,10 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev1
  * @author michal.polkorab
  */
 public class OF10SetDlDstActionDeserializer extends AbstractActionDeserializer {
-
     @Override
     public Action deserialize(final ByteBuf input) {
         final ActionBuilder builder = new ActionBuilder();
-        input.skipBytes(2 * EncodeConstants.SIZE_OF_SHORT_IN_BYTES);
+        input.skipBytes(2 * Short.BYTES);
         SetDlDstCaseBuilder caseBuilder = new SetDlDstCaseBuilder();
         SetDlDstActionBuilder actionBuilder = new SetDlDstActionBuilder();
         actionBuilder.setDlDstAddress(ByteBufUtils.readIetfMacAddress(input));
@@ -42,5 +39,4 @@ public class OF10SetDlDstActionDeserializer extends AbstractActionDeserializer {
     protected ActionChoice getType() {
         return new SetDlDstCaseBuilder().build();
     }
-
 }
index e471881fac03ae8d4921c0c3a3f690fc96af230f..4cd9a6cfe0b73682f27843cb204d502742bc871c 100644 (file)
@@ -5,11 +5,9 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowjava.protocol.impl.deserialization.action;
 
 import io.netty.buffer.ByteBuf;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.impl.util.ActionConstants;
 import org.opendaylight.openflowjava.util.ByteBufUtils;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.ActionChoice;
@@ -24,11 +22,10 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev1
  * @author michal.polkorab
  */
 public class OF10SetDlSrcActionDeserializer extends AbstractActionDeserializer {
-
     @Override
     public Action deserialize(final ByteBuf input) {
         final ActionBuilder builder = new ActionBuilder();
-        input.skipBytes(2 * EncodeConstants.SIZE_OF_SHORT_IN_BYTES);
+        input.skipBytes(2 * Short.BYTES);
         SetDlSrcCaseBuilder caseBuilder = new SetDlSrcCaseBuilder();
         SetDlSrcActionBuilder actionBuilder = new SetDlSrcActionBuilder();
         actionBuilder.setDlSrcAddress(ByteBufUtils.readIetfMacAddress(input));
@@ -42,5 +39,4 @@ public class OF10SetDlSrcActionDeserializer extends AbstractActionDeserializer {
     protected ActionChoice getType() {
         return new SetDlSrcCaseBuilder().build();
     }
-
 }
index eb454ab81a5a94c6c6169892e78ea15a5e56870e..7a05b716dd978807b2d847ce47b980554ddc34e7 100644 (file)
@@ -5,11 +5,9 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowjava.protocol.impl.deserialization.action;
 
 import io.netty.buffer.ByteBuf;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.util.ByteBufUtils;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.ActionChoice;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.SetNwDstCaseBuilder;
@@ -23,11 +21,10 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev1
  * @author michal.polkorab
  */
 public class OF10SetNwDstActionDeserializer extends AbstractActionDeserializer {
-
     @Override
     public Action deserialize(final ByteBuf input) {
         final ActionBuilder builder = new ActionBuilder();
-        input.skipBytes(2 * EncodeConstants.SIZE_OF_SHORT_IN_BYTES);
+        input.skipBytes(2 * Short.BYTES);
         SetNwDstCaseBuilder caseBuilder = new SetNwDstCaseBuilder();
         SetNwDstActionBuilder actionBuilder = new SetNwDstActionBuilder();
         actionBuilder.setIpAddress(ByteBufUtils.readIetfIpv4Address(input));
@@ -40,5 +37,4 @@ public class OF10SetNwDstActionDeserializer extends AbstractActionDeserializer {
     protected ActionChoice getType() {
         return new SetNwDstCaseBuilder().build();
     }
-
 }
index 972dfdb9ef6ab7193a5fc46b02b4e7ae732454b3..c9bce5a72023bd88772fc69672126fa6481d5515 100644 (file)
@@ -5,11 +5,9 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowjava.protocol.impl.deserialization.action;
 
 import io.netty.buffer.ByteBuf;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.util.ByteBufUtils;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.ActionChoice;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.SetNwSrcCaseBuilder;
@@ -23,11 +21,10 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev1
  * @author michal.polkorab
  */
 public class OF10SetNwSrcActionDeserializer extends AbstractActionDeserializer {
-
     @Override
     public Action deserialize(final ByteBuf input) {
         final ActionBuilder builder = new ActionBuilder();
-        input.skipBytes(2 * EncodeConstants.SIZE_OF_SHORT_IN_BYTES);
+        input.skipBytes(2 * Short.BYTES);
         SetNwSrcCaseBuilder caseBuilder = new SetNwSrcCaseBuilder();
         SetNwSrcActionBuilder actionBuilder = new SetNwSrcActionBuilder();
         actionBuilder.setIpAddress(ByteBufUtils.readIetfIpv4Address(input));
@@ -40,5 +37,4 @@ public class OF10SetNwSrcActionDeserializer extends AbstractActionDeserializer {
     protected ActionChoice getType() {
         return new SetNwSrcCaseBuilder().build();
     }
-
 }
index be0554b2d81307227113a2c6f44e44e56b17ad38..732f0d4be649f9b56f62178be800f0b8aa5e7aba 100644 (file)
@@ -10,7 +10,6 @@ package org.opendaylight.openflowjava.protocol.impl.deserialization.action;
 import static org.opendaylight.yangtools.yang.common.netty.ByteBufUtils.readUint8;
 
 import io.netty.buffer.ByteBuf;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.impl.util.ActionConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.ActionChoice;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.SetNwTosCaseBuilder;
@@ -27,7 +26,7 @@ public class OF10SetNwTosActionDeserializer extends AbstractActionDeserializer {
     @Override
     public Action deserialize(ByteBuf input) {
         final ActionBuilder builder = new ActionBuilder();
-        input.skipBytes(2 * EncodeConstants.SIZE_OF_SHORT_IN_BYTES);
+        input.skipBytes(2 * Short.BYTES);
         SetNwTosCaseBuilder caseBuilder = new SetNwTosCaseBuilder();
         SetNwTosActionBuilder tosBuilder = new SetNwTosActionBuilder();
         tosBuilder.setNwTos(readUint8(input));
index 91d8bf0f81cc48cef14bab75d74a084932e3368f..68e34163b045b99a165b6cd50983d117fcbd2c3e 100644 (file)
@@ -10,7 +10,6 @@ package org.opendaylight.openflowjava.protocol.impl.deserialization.action;
 import static org.opendaylight.yangtools.yang.common.netty.ByteBufUtils.readUint16;
 
 import io.netty.buffer.ByteBuf;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.impl.util.ActionConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.ActionChoice;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.SetTpDstCaseBuilder;
@@ -28,7 +27,7 @@ public class OF10SetTpDstActionDeserializer extends AbstractActionDeserializer {
     @Override
     public Action deserialize(ByteBuf input) {
         final ActionBuilder builder = new ActionBuilder();
-        input.skipBytes(2 * EncodeConstants.SIZE_OF_SHORT_IN_BYTES);
+        input.skipBytes(2 * Short.BYTES);
         SetTpDstCaseBuilder caseBuilder = new SetTpDstCaseBuilder();
         SetTpDstActionBuilder actionBuilder = new SetTpDstActionBuilder();
         actionBuilder.setPort(new PortNumber(readUint16(input).toUint32()));
index 95139c92a31b52d63736da554d9e670bf516b23e..74c4901fc6a9802f158e8a146ec0876031b33c8a 100644 (file)
@@ -10,7 +10,6 @@ package org.opendaylight.openflowjava.protocol.impl.deserialization.action;
 import static org.opendaylight.yangtools.yang.common.netty.ByteBufUtils.readUint16;
 
 import io.netty.buffer.ByteBuf;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.impl.util.ActionConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.ActionChoice;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.SetTpSrcCaseBuilder;
@@ -28,7 +27,7 @@ public class OF10SetTpSrcActionDeserializer extends AbstractActionDeserializer {
     @Override
     public Action deserialize(ByteBuf input) {
         final ActionBuilder builder = new ActionBuilder();
-        input.skipBytes(2 * EncodeConstants.SIZE_OF_SHORT_IN_BYTES);
+        input.skipBytes(2 * Short.BYTES);
         SetTpSrcCaseBuilder caseBuilder = new SetTpSrcCaseBuilder();
         SetTpSrcActionBuilder actionBuilder = new SetTpSrcActionBuilder();
         actionBuilder.setPort(new PortNumber(readUint16(input).toUint32()));
index 15a3bcc691e4725950184d2a5747bc737d79816e..af9acec04939d1fd569eac2cc5fbd23c91d0ed63 100644 (file)
@@ -10,7 +10,6 @@ package org.opendaylight.openflowjava.protocol.impl.deserialization.action;
 import static org.opendaylight.yangtools.yang.common.netty.ByteBufUtils.readUint8;
 
 import io.netty.buffer.ByteBuf;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.impl.util.ActionConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.ActionChoice;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.SetVlanPcpCaseBuilder;
@@ -26,9 +25,8 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev1
 public class OF10SetVlanPcpActionDeserializer extends AbstractActionDeserializer {
     @Override
     public Action deserialize(ByteBuf input) {
-        final org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.actions.grouping
-            .ActionBuilder builder = new ActionBuilder();
-        input.skipBytes(2 * EncodeConstants.SIZE_OF_SHORT_IN_BYTES);
+        final ActionBuilder builder = new ActionBuilder();
+        input.skipBytes(2 * Short.BYTES);
         SetVlanPcpCaseBuilder caseBuilder = new SetVlanPcpCaseBuilder();
         SetVlanPcpActionBuilder actionBuilder = new SetVlanPcpActionBuilder();
         actionBuilder.setVlanPcp(readUint8(input));
index 223cbaee94fe20445e8abbb28dc57035eef73fea..25f19a67070f836a817370a1f96d17657c5bee06 100644 (file)
@@ -10,7 +10,6 @@ package org.opendaylight.openflowjava.protocol.impl.deserialization.action;
 import static org.opendaylight.yangtools.yang.common.netty.ByteBufUtils.readUint16;
 
 import io.netty.buffer.ByteBuf;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.impl.util.ActionConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.ActionChoice;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.SetVlanVidCaseBuilder;
@@ -24,10 +23,9 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev1
  * @author michal.polkorab
  */
 public class OF10SetVlanVidActionDeserializer extends AbstractActionDeserializer {
-
     @Override
     public Action deserialize(ByteBuf input) {
-        input.skipBytes(2 * EncodeConstants.SIZE_OF_SHORT_IN_BYTES);
+        input.skipBytes(2 * Short.BYTES);
         final ActionBuilder builder = new ActionBuilder()
                 .setActionChoice(new SetVlanVidCaseBuilder()
                     .setSetVlanVidAction(new SetVlanVidActionBuilder().setVlanVid(readUint16(input)).build())
@@ -40,5 +38,4 @@ public class OF10SetVlanVidActionDeserializer extends AbstractActionDeserializer
     protected ActionChoice getType() {
         return new SetVlanVidCaseBuilder().build();
     }
-
 }
index 6ef46855ad55533018b6a49a83bbd87abc806758..7ea0233322e52b7144554015ed3b4cb6519a5312 100644 (file)
@@ -5,11 +5,9 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowjava.protocol.impl.deserialization.action;
 
 import io.netty.buffer.ByteBuf;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.impl.util.ActionConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.ActionChoice;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.StripVlanCaseBuilder;
@@ -22,11 +20,10 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev1
  * @author michal.polkorab
  */
 public class OF10StripVlanActionDeserializer extends AbstractActionDeserializer {
-
     @Override
     public Action deserialize(ByteBuf input) {
         final ActionBuilder builder = new ActionBuilder();
-        input.skipBytes(2 * EncodeConstants.SIZE_OF_SHORT_IN_BYTES);
+        input.skipBytes(2 * Short.BYTES);
         builder.setActionChoice(getType());
         input.skipBytes(ActionConstants.PADDING_IN_ACTION_HEADER);
         return builder.build();
@@ -36,5 +33,4 @@ public class OF10StripVlanActionDeserializer extends AbstractActionDeserializer
     protected ActionChoice getType() {
         return new StripVlanCaseBuilder().build();
     }
-
 }
index 9eff6266ceecb3d1ce575b8cda5b1fcb46173efc..7649a4c573368a02ec43cd80c14a36b9ae6c29f1 100644 (file)
@@ -5,11 +5,9 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowjava.protocol.impl.deserialization.action;
 
 import io.netty.buffer.ByteBuf;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.impl.util.ActionConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.ActionChoice;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.CopyTtlInCaseBuilder;
@@ -22,11 +20,10 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev1
  * @author michal.polkorab
  */
 public class OF13CopyTtlInActionDeserializer extends AbstractActionDeserializer {
-
     @Override
     public Action deserialize(ByteBuf input) {
         ActionBuilder builder = new ActionBuilder();
-        input.skipBytes(2 * EncodeConstants.SIZE_OF_SHORT_IN_BYTES);
+        input.skipBytes(2 * Short.BYTES);
         builder.setActionChoice(getType());
         input.skipBytes(ActionConstants.PADDING_IN_ACTION_HEADER);
         return builder.build();
@@ -36,5 +33,4 @@ public class OF13CopyTtlInActionDeserializer extends AbstractActionDeserializer
     protected ActionChoice getType() {
         return new CopyTtlInCaseBuilder().build();
     }
-
 }
index 2513932507ad767623b36b1ecc3461d3c1011bde..62b1ac7f844c52cb8abda3b6787b9782927f3c2c 100644 (file)
@@ -5,11 +5,9 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowjava.protocol.impl.deserialization.action;
 
 import io.netty.buffer.ByteBuf;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.impl.util.ActionConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.ActionChoice;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.CopyTtlOutCaseBuilder;
@@ -22,11 +20,10 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev1
  * @author michal.polkorab
  */
 public class OF13CopyTtlOutActionDeserializer extends AbstractActionDeserializer {
-
     @Override
     public Action deserialize(ByteBuf input) {
         ActionBuilder builder = new ActionBuilder();
-        input.skipBytes(2 * EncodeConstants.SIZE_OF_SHORT_IN_BYTES);
+        input.skipBytes(2 * Short.BYTES);
         builder.setActionChoice(getType());
         input.skipBytes(ActionConstants.PADDING_IN_ACTION_HEADER);
         return builder.build();
@@ -36,5 +33,4 @@ public class OF13CopyTtlOutActionDeserializer extends AbstractActionDeserializer
     protected ActionChoice getType() {
         return new CopyTtlOutCaseBuilder().build();
     }
-
 }
index 7d192f473b70d312ee19ecc6b113173c4dab4bd4..a55e21c1c1d65ef50dc7cf1628957b89e357e17b 100644 (file)
@@ -5,11 +5,9 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowjava.protocol.impl.deserialization.action;
 
 import io.netty.buffer.ByteBuf;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.impl.util.ActionConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.ActionChoice;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.DecMplsTtlCaseBuilder;
@@ -22,11 +20,10 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev1
  * @author michal.polkorab
  */
 public class OF13DecMplsTtlActionDeserializer extends AbstractActionDeserializer {
-
     @Override
     public Action deserialize(ByteBuf input) {
         ActionBuilder builder = new ActionBuilder();
-        input.skipBytes(2 * EncodeConstants.SIZE_OF_SHORT_IN_BYTES);
+        input.skipBytes(2 * Short.BYTES);
         builder.setActionChoice(getType());
         input.skipBytes(ActionConstants.PADDING_IN_ACTION_HEADER);
         return builder.build();
@@ -36,5 +33,4 @@ public class OF13DecMplsTtlActionDeserializer extends AbstractActionDeserializer
     protected ActionChoice getType() {
         return new DecMplsTtlCaseBuilder().build();
     }
-
 }
index 3cfe775cb335eb5267c794938d6938512cebacb9..27ea45c3f5217ff8e66fdcf61d08d95503b3260d 100644 (file)
@@ -5,11 +5,9 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowjava.protocol.impl.deserialization.action;
 
 import io.netty.buffer.ByteBuf;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.impl.util.ActionConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.ActionChoice;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.DecNwTtlCaseBuilder;
@@ -22,11 +20,10 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev1
  * @author michal.polkorab
  */
 public class OF13DecNwTtlActionDeserializer extends AbstractActionDeserializer {
-
     @Override
     public Action deserialize(ByteBuf input) {
         ActionBuilder builder = new ActionBuilder();
-        input.skipBytes(2 * EncodeConstants.SIZE_OF_SHORT_IN_BYTES);
+        input.skipBytes(2 * Short.BYTES);
         builder.setActionChoice(getType());
         input.skipBytes(ActionConstants.PADDING_IN_ACTION_HEADER);
         return builder.build();
@@ -36,5 +33,4 @@ public class OF13DecNwTtlActionDeserializer extends AbstractActionDeserializer {
     protected ActionChoice getType() {
         return new DecNwTtlCaseBuilder().build();
     }
-
 }
index be361a02df430ffa5207c463ac94cd418ec232e3..d7627fe5db8df902fdc02ddc19165ad7dfe84d04 100644 (file)
@@ -10,7 +10,6 @@ package org.opendaylight.openflowjava.protocol.impl.deserialization.action;
 import static org.opendaylight.yangtools.yang.common.netty.ByteBufUtils.readUint32;
 
 import io.netty.buffer.ByteBuf;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.ActionChoice;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.GroupCaseBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.group._case.GroupActionBuilder;
@@ -25,7 +24,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev1
 public class OF13GroupActionDeserializer extends AbstractActionDeserializer {
     @Override
     public Action deserialize(ByteBuf input) {
-        input.skipBytes(2 * EncodeConstants.SIZE_OF_SHORT_IN_BYTES);
+        input.skipBytes(2 * Short.BYTES);
         return new ActionBuilder()
                 .setActionChoice(new GroupCaseBuilder()
                     .setGroupAction(new GroupActionBuilder().setGroupId(readUint32(input)).build())
index 4d57adc980e1f9608e93a1259af6c8c37d471329..2d32ce60e192c892d3b518553a0811f15f9a29b9 100644 (file)
@@ -11,7 +11,6 @@ import static org.opendaylight.yangtools.yang.common.netty.ByteBufUtils.readUint
 import static org.opendaylight.yangtools.yang.common.netty.ByteBufUtils.readUint32;
 
 import io.netty.buffer.ByteBuf;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.impl.util.ActionConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.ActionChoice;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.OutputActionCaseBuilder;
@@ -30,7 +29,7 @@ public class OF13OutputActionDeserializer extends AbstractActionDeserializer {
     public Action deserialize(ByteBuf input) {
         final org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.actions.grouping
             .ActionBuilder builder = new ActionBuilder();
-        input.skipBytes(2 * EncodeConstants.SIZE_OF_SHORT_IN_BYTES);
+        input.skipBytes(2 * Short.BYTES);
         OutputActionCaseBuilder caseBuilder = new OutputActionCaseBuilder();
         OutputActionBuilder actionBuilder = new OutputActionBuilder();
         actionBuilder.setPort(new PortNumber(readUint32(input)));
index f4c15c7d6b0634e9c0dfa6a87014e623b152897e..a56480cc042ce6a20345cdd6482261fc100e3bfe 100644 (file)
@@ -8,7 +8,6 @@
 package org.opendaylight.openflowjava.protocol.impl.deserialization.action;
 
 import io.netty.buffer.ByteBuf;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.impl.util.ActionConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.ActionChoice;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.PopMplsCaseBuilder;
@@ -26,7 +25,7 @@ import org.opendaylight.yangtools.yang.common.netty.ByteBufUtils;
 public class OF13PopMplsActionDeserializer extends AbstractActionDeserializer {
     @Override
     public Action deserialize(ByteBuf input) {
-        input.skipBytes(2 * EncodeConstants.SIZE_OF_SHORT_IN_BYTES);
+        input.skipBytes(2 * Short.BYTES);
         final ActionBuilder builder = new ActionBuilder()
                 .setActionChoice(new PopMplsCaseBuilder()
                     .setPopMplsAction(new PopMplsActionBuilder()
index 6f22056bf808f21276bfe721133bcf747b284e0c..f3d404382e8a281787a84744aca284ed9c3bf5f9 100644 (file)
@@ -5,11 +5,9 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowjava.protocol.impl.deserialization.action;
 
 import io.netty.buffer.ByteBuf;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.impl.util.ActionConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.ActionChoice;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.PopPbbCaseBuilder;
@@ -22,11 +20,10 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev1
  * @author michal.polkorab
  */
 public class OF13PopPbbActionDeserializer extends AbstractActionDeserializer {
-
     @Override
     public Action deserialize(ByteBuf input) {
         ActionBuilder builder = new ActionBuilder();
-        input.skipBytes(2 * EncodeConstants.SIZE_OF_SHORT_IN_BYTES);
+        input.skipBytes(2 * Short.BYTES);
         builder.setActionChoice(getType());
         input.skipBytes(ActionConstants.PADDING_IN_ACTION_HEADER);
         return builder.build();
@@ -36,5 +33,4 @@ public class OF13PopPbbActionDeserializer extends AbstractActionDeserializer {
     protected ActionChoice getType() {
         return new PopPbbCaseBuilder().build();
     }
-
 }
index 59fe01aa630f7fac52b79f41e4b25844d81ef54b..b0c5fabc33c738b701f2a98258d6fe96c3270169 100644 (file)
@@ -5,11 +5,9 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowjava.protocol.impl.deserialization.action;
 
 import io.netty.buffer.ByteBuf;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.impl.util.ActionConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.ActionChoice;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.PopVlanCaseBuilder;
@@ -22,11 +20,10 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev1
  * @author michal.polkorab
  */
 public class OF13PopVlanActionDeserializer extends AbstractActionDeserializer {
-
     @Override
     public Action deserialize(ByteBuf input) {
         ActionBuilder builder = new ActionBuilder();
-        input.skipBytes(2 * EncodeConstants.SIZE_OF_SHORT_IN_BYTES);
+        input.skipBytes(2 * Short.BYTES);
         builder.setActionChoice(getType());
         input.skipBytes(ActionConstants.PADDING_IN_ACTION_HEADER);
         return builder.build();
@@ -36,5 +33,4 @@ public class OF13PopVlanActionDeserializer extends AbstractActionDeserializer {
     protected ActionChoice getType() {
         return new PopVlanCaseBuilder().build();
     }
-
 }
index abd1284b88e32568a8580b3333ffc744516d4da7..78500f4fec7ed9b1ae2e670440803c5c2125f13b 100644 (file)
@@ -8,7 +8,6 @@
 package org.opendaylight.openflowjava.protocol.impl.deserialization.action;
 
 import io.netty.buffer.ByteBuf;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.impl.util.ActionConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.ActionChoice;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.PushMplsCaseBuilder;
@@ -24,11 +23,10 @@ import org.opendaylight.yangtools.yang.common.netty.ByteBufUtils;
  * @author michal.polkorab
  */
 public class OF13PushMplsActionDeserializer extends AbstractActionDeserializer {
-
     @Override
     public Action deserialize(ByteBuf input) {
         final ActionBuilder builder = new ActionBuilder();
-        input.skipBytes(2 * EncodeConstants.SIZE_OF_SHORT_IN_BYTES);
+        input.skipBytes(2 * Short.BYTES);
         PushMplsCaseBuilder caseBuilder = new PushMplsCaseBuilder();
         PushMplsActionBuilder mplsBuilder = new PushMplsActionBuilder();
         mplsBuilder.setEthertype(new EtherType(ByteBufUtils.readUint16(input)));
index 33c81495807f323aafcf5f6daec256ec9436ff3e..fdc31a9e932c0da1c1dbed60288b0934b4c69b01 100644 (file)
@@ -8,7 +8,6 @@
 package org.opendaylight.openflowjava.protocol.impl.deserialization.action;
 
 import io.netty.buffer.ByteBuf;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.impl.util.ActionConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.ActionChoice;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.PushPbbCaseBuilder;
@@ -26,7 +25,7 @@ import org.opendaylight.yangtools.yang.common.netty.ByteBufUtils;
 public class OF13PushPbbActionDeserializer extends AbstractActionDeserializer {
     @Override
     public Action deserialize(ByteBuf input) {
-        input.skipBytes(2 * EncodeConstants.SIZE_OF_SHORT_IN_BYTES);
+        input.skipBytes(2 * Short.BYTES);
         final ActionBuilder builder = new ActionBuilder()
                 .setActionChoice(new PushPbbCaseBuilder()
                     .setPushPbbAction(new PushPbbActionBuilder()
index f7ad0c92dcf533672f9853099cb4bc7788f27c41..98dd065ffa8ab2f5da456bd3272f667409f31336 100644 (file)
@@ -8,7 +8,6 @@
 package org.opendaylight.openflowjava.protocol.impl.deserialization.action;
 
 import io.netty.buffer.ByteBuf;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.impl.util.ActionConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.ActionChoice;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.PushVlanCaseBuilder;
@@ -26,7 +25,7 @@ import org.opendaylight.yangtools.yang.common.netty.ByteBufUtils;
 public class OF13PushVlanActionDeserializer extends AbstractActionDeserializer {
     @Override
     public Action deserialize(ByteBuf input) {
-        input.skipBytes(2 * EncodeConstants.SIZE_OF_SHORT_IN_BYTES);
+        input.skipBytes(2 * Short.BYTES);
         final ActionBuilder builder = new ActionBuilder()
                 .setActionChoice(new PushVlanCaseBuilder()
                     .setPushVlanAction(new PushVlanActionBuilder()
index f4689ce110f2acc4c596fac3e52a8b777fa714cd..35692b979a132940cdf5b466e3597074ed74ec38 100644 (file)
@@ -44,18 +44,16 @@ public class OF13SetFieldActionDeserializer extends AbstractActionDeserializer
         final  org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.actions.grouping
             .ActionBuilder builder = new ActionBuilder();
         final int startIndex = input.readerIndex();
-        input.skipBytes(2 * EncodeConstants.SIZE_OF_SHORT_IN_BYTES);
+        input.skipBytes(2 * Short.BYTES);
         final SetFieldCaseBuilder caseBuilder = new SetFieldCaseBuilder();
         SetFieldActionBuilder actionBuilder = new SetFieldActionBuilder();
         int oxmClass = input.getUnsignedShort(input.readerIndex());
         // get oxm_field & hasMask byte and extract the field value
-        int oxmField = input.getUnsignedByte(input.readerIndex()
-                + EncodeConstants.SIZE_OF_SHORT_IN_BYTES) >>> 1;
+        int oxmField = input.getUnsignedByte(input.readerIndex() + Short.BYTES) >>> 1;
         MatchEntryDeserializerKey key = new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID,
                 oxmClass, oxmField);
         if (oxmClass == EncodeConstants.EXPERIMENTER_VALUE) {
-            long expId = input.getUnsignedInt(input.readerIndex() + EncodeConstants.SIZE_OF_SHORT_IN_BYTES
-                    + 2 * EncodeConstants.SIZE_OF_BYTE_IN_BYTES);
+            long expId = input.getUnsignedInt(input.readerIndex() + Short.BYTES + 2 * Byte.BYTES);
             key.setExperimenterId(Uint32.valueOf(expId));
         }
         OFDeserializer<MatchEntry> matchDeserializer = registry.getDeserializer(key);
index 150d58a5f99a4ced0c5463622b76da553d009257..bff2eac264660bbee34ff3e64d60bce6e6784ddf 100644 (file)
@@ -10,7 +10,6 @@ package org.opendaylight.openflowjava.protocol.impl.deserialization.action;
 import static org.opendaylight.yangtools.yang.common.netty.ByteBufUtils.readUint8;
 
 import io.netty.buffer.ByteBuf;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.impl.util.ActionConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.ActionChoice;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.SetMplsTtlCaseBuilder;
@@ -27,7 +26,7 @@ public class OF13SetMplsTtlActionDeserializer extends AbstractActionDeserializer
     @Override
     public Action deserialize(ByteBuf input) {
         final ActionBuilder builder = new ActionBuilder();
-        input.skipBytes(2 * EncodeConstants.SIZE_OF_SHORT_IN_BYTES);
+        input.skipBytes(2 * Short.BYTES);
         SetMplsTtlCaseBuilder caseBuilder = new SetMplsTtlCaseBuilder();
         SetMplsTtlActionBuilder actionBuilder = new SetMplsTtlActionBuilder();
         actionBuilder.setMplsTtl(readUint8(input));
index ac6408dd1730ba6e9497bb647521bbbeff72c0f8..8c4b23a3c36f8b5236a78d724efebb643a0acddb 100644 (file)
@@ -10,7 +10,6 @@ package org.opendaylight.openflowjava.protocol.impl.deserialization.action;
 import static org.opendaylight.yangtools.yang.common.netty.ByteBufUtils.readUint8;
 
 import io.netty.buffer.ByteBuf;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.impl.util.ActionConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.ActionChoice;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.SetNwTtlCaseBuilder;
@@ -27,7 +26,7 @@ public class OF13SetNwTtlActionDeserializer extends AbstractActionDeserializer {
     @Override
     public Action deserialize(ByteBuf input) {
         final ActionBuilder builder = new ActionBuilder();
-        input.skipBytes(2 * EncodeConstants.SIZE_OF_SHORT_IN_BYTES);
+        input.skipBytes(2 * Short.BYTES);
         SetNwTtlCaseBuilder caseBuilder = new SetNwTtlCaseBuilder();
         SetNwTtlActionBuilder actionBuilder = new SetNwTtlActionBuilder();
         actionBuilder.setNwTtl(readUint8(input));
index 915296250c7c6c5221302e3ea15a6c8cb20cfad0..d71c28a6e40640ce08e0b7822b5e60bbe513aef7 100644 (file)
@@ -10,7 +10,6 @@ package org.opendaylight.openflowjava.protocol.impl.deserialization.action;
 import static org.opendaylight.yangtools.yang.common.netty.ByteBufUtils.readUint32;
 
 import io.netty.buffer.ByteBuf;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.ActionChoice;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.SetQueueCaseBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.set.queue._case.SetQueueActionBuilder;
@@ -26,7 +25,7 @@ public class OF13SetQueueActionDeserializer extends AbstractActionDeserializer {
     @Override
     public Action deserialize(ByteBuf input) {
         final ActionBuilder builder = new ActionBuilder();
-        input.skipBytes(2 * EncodeConstants.SIZE_OF_SHORT_IN_BYTES);
+        input.skipBytes(2 * Short.BYTES);
         SetQueueCaseBuilder caseBuilder = new SetQueueCaseBuilder();
         SetQueueActionBuilder actionBuilder = new SetQueueActionBuilder();
         actionBuilder.setQueueId(readUint32(input));
index bdd3829bf510c3b42a4894a1612697f8e739d836..1196e416a386981d69871ea73922485e164e9eb2 100644 (file)
@@ -63,7 +63,7 @@ public class ErrorMessageFactory implements OFDeserializer<ErrorMessage>,
             OFDeserializer<ErrorMessage> deserializer = registry.getDeserializer(
                     ExperimenterDeserializerKeyFactory.createExperimenterErrorDeserializerKey(
                             EncodeConstants.OF13_VERSION_ID, rawMessage.getUnsignedInt(
-                                    rawMessage.readerIndex() + EncodeConstants.SIZE_OF_SHORT_IN_BYTES)));
+                                    rawMessage.readerIndex() + Short.BYTES)));
             rawMessage.readerIndex(startIndex);
             return deserializer.deserialize(rawMessage);
         }
index a1c2a051a8f1ffa8a58d26e7b9b4f3ae5d163c0d..fdcef1b3fa4dae5adb0a62711340209d08f72a13 100644 (file)
@@ -92,8 +92,7 @@ public class MeterModInputMessageFactory implements OFDeserializer<MeterModInput
                     bandsBuilder.setMeterBand(bandDscpRemarkCaseBuilder.build());
                     break;
                 case 0xFFFF:
-                    long expId = rawMessage.getUnsignedInt(rawMessage.readerIndex()
-                            + 2 * EncodeConstants.SIZE_OF_INT_IN_BYTES);
+                    long expId = rawMessage.getUnsignedInt(rawMessage.readerIndex() + 2 * Integer.BYTES);
                     rawMessage.readerIndex(bandStartIndex);
                     OFDeserializer<MeterBandExperimenterCase> deserializer = registry
                             .getDeserializer(ExperimenterDeserializerKeyFactory
index bba1bde59e4f8a226db87b0b1487c6dba53afe69..07718e1f77354be445b0400986eff411ee04e224 100644 (file)
@@ -278,7 +278,7 @@ public class MultipartReplyMessageFactory implements OFDeserializer<MultipartRep
         while (input.readableBytes() > 0) {
             FlowStatsBuilder flowStatsBuilder = new FlowStatsBuilder();
             int flowRecordLength = input.readUnsignedShort();
-            ByteBuf subInput = input.readSlice(flowRecordLength - EncodeConstants.SIZE_OF_SHORT_IN_BYTES);
+            ByteBuf subInput = input.readSlice(flowRecordLength - Short.BYTES);
             flowStatsBuilder.setTableId(readUint8(subInput));
             subInput.skipBytes(PADDING_IN_FLOW_STATS_HEADER_01);
             flowStatsBuilder.setDurationSec(readUint32(subInput));
@@ -355,10 +355,10 @@ public class MultipartReplyMessageFactory implements OFDeserializer<MultipartRep
             featuresBuilder.setTableId(readUint8(input));
             input.skipBytes(PADDING_IN_MULTIPART_REPLY_TABLE_FEATURES);
             featuresBuilder.setName(ByteBufUtils.decodeNullTerminatedString(input, MAX_TABLE_NAME_LENGTH));
-            byte[] metadataMatch = new byte[EncodeConstants.SIZE_OF_LONG_IN_BYTES];
+            byte[] metadataMatch = new byte[Long.BYTES];
             input.readBytes(metadataMatch);
             featuresBuilder.setMetadataMatch(metadataMatch);
-            byte[] metadataWrite = new byte[EncodeConstants.SIZE_OF_LONG_IN_BYTES];
+            byte[] metadataWrite = new byte[Long.BYTES];
             input.readBytes(metadataWrite);
             featuresBuilder.setMetadataWrite(metadataWrite);
             featuresBuilder.setConfig(createTableConfig(input.readUnsignedInt()));
@@ -628,8 +628,7 @@ public class MultipartReplyMessageFactory implements OFDeserializer<MultipartRep
                         break;
                     case 0xFFFF:
                         actualLength += input.readUnsignedShort();
-                        final long expId = input.getUnsignedInt(input.readerIndex()
-                                + 2 * EncodeConstants.SIZE_OF_INT_IN_BYTES);
+                        final long expId = input.getUnsignedInt(input.readerIndex() + 2 * Integer.BYTES);
                         input.readerIndex(bandStartIndex);
                         OFDeserializer<MeterBandExperimenterCase> deserializer = registry.getDeserializer(
                                 ExperimenterDeserializerKeyFactory.createMeterBandDeserializerKey(
index a963f498cdf7fe855f828d571268dbf8c80e45e2..b5ab75216d78014d20deb49a7d62038c3f8e4365 100644 (file)
@@ -5,12 +5,10 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowjava.protocol.impl.deserialization.instruction;
 
 import io.netty.buffer.ByteBuf;
 import org.opendaylight.openflowjava.protocol.api.extensibility.HeaderDeserializer;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.impl.util.InstructionConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.instruction.rev130731.instruction.grouping.instruction.choice.ApplyActionsCaseBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.instruction.rev130731.instruction.grouping.instruction.choice.apply.actions._case.ApplyActionsBuilder;
@@ -24,11 +22,10 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.instruction
  */
 public class ApplyActionsInstructionDeserializer extends AbstractActionInstructionDeserializer
         implements HeaderDeserializer<Instruction> {
-
     @Override
     public Instruction deserialize(ByteBuf input) {
         final InstructionBuilder builder = new InstructionBuilder();
-        input.skipBytes(EncodeConstants.SIZE_OF_SHORT_IN_BYTES);
+        input.skipBytes(Short.BYTES);
         int instructionLength = input.readUnsignedShort();
         input.skipBytes(InstructionConstants.PADDING_IN_ACTIONS_INSTRUCTION);
         ApplyActionsCaseBuilder caseBuilder = new ApplyActionsCaseBuilder();
@@ -42,9 +39,8 @@ public class ApplyActionsInstructionDeserializer extends AbstractActionInstructi
     @Override
     public Instruction deserializeHeader(ByteBuf input) {
         InstructionBuilder builder = new InstructionBuilder();
-        input.skipBytes(2 * EncodeConstants.SIZE_OF_SHORT_IN_BYTES);
+        input.skipBytes(2 * Short.BYTES);
         builder.setInstructionChoice(new ApplyActionsCaseBuilder().build());
         return builder.build();
     }
-
 }
index dfbba719e66ffd0422f62e5b03aae03020866651..652327b236294ac0032a2c6f27ceb074f7fb264f 100644 (file)
@@ -5,13 +5,11 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowjava.protocol.impl.deserialization.instruction;
 
 import io.netty.buffer.ByteBuf;
 import org.opendaylight.openflowjava.protocol.api.extensibility.HeaderDeserializer;
 import org.opendaylight.openflowjava.protocol.api.extensibility.OFDeserializer;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.impl.util.InstructionConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.instruction.rev130731.instruction.grouping.instruction.choice.ClearActionsCaseBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.instruction.rev130731.instructions.grouping.Instruction;
@@ -24,11 +22,10 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.instruction
  */
 public class ClearActionsInstructionDeserializer implements OFDeserializer<Instruction>,
         HeaderDeserializer<Instruction> {
-
     @Override
     public Instruction deserialize(ByteBuf input) {
         InstructionBuilder builder =  new InstructionBuilder();
-        input.skipBytes(2 * EncodeConstants.SIZE_OF_SHORT_IN_BYTES);
+        input.skipBytes(2 * Short.BYTES);
         input.skipBytes(InstructionConstants.PADDING_IN_ACTIONS_INSTRUCTION);
         builder.setInstructionChoice(new ClearActionsCaseBuilder().build());
         return builder.build();
@@ -37,7 +34,7 @@ public class ClearActionsInstructionDeserializer implements OFDeserializer<Instr
     @Override
     public Instruction deserializeHeader(ByteBuf input) {
         InstructionBuilder builder = new InstructionBuilder();
-        input.skipBytes(2 * EncodeConstants.SIZE_OF_SHORT_IN_BYTES);
+        input.skipBytes(2 * Short.BYTES);
         builder.setInstructionChoice(new ClearActionsCaseBuilder().build());
         return builder.build();
     }
index 96038dd744d007b8508ff0bbd53502013d21ad1f..fa18105bd0bc5eb9ec5dfd0c3ed8c3f6390ffbca 100644 (file)
@@ -12,7 +12,6 @@ import static org.opendaylight.yangtools.yang.common.netty.ByteBufUtils.readUint
 import io.netty.buffer.ByteBuf;
 import org.opendaylight.openflowjava.protocol.api.extensibility.HeaderDeserializer;
 import org.opendaylight.openflowjava.protocol.api.extensibility.OFDeserializer;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.impl.util.InstructionConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.instruction.rev130731.instruction.grouping.instruction.choice.GotoTableCaseBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.instruction.rev130731.instruction.grouping.instruction.choice._goto.table._case.GotoTableBuilder;
@@ -26,10 +25,9 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.instruction
  */
 public class GoToTableInstructionDeserializer  implements OFDeserializer<Instruction>,
         HeaderDeserializer<Instruction> {
-
     @Override
     public Instruction deserialize(ByteBuf input) {
-        input.skipBytes(2 * EncodeConstants.SIZE_OF_SHORT_IN_BYTES);
+        input.skipBytes(2 * Short.BYTES);
         final InstructionBuilder builder = new InstructionBuilder()
                 .setInstructionChoice(new GotoTableCaseBuilder()
                     .setGotoTable(new GotoTableBuilder().setTableId(readUint8(input)).build())
@@ -40,7 +38,7 @@ public class GoToTableInstructionDeserializer  implements OFDeserializer<Instruc
 
     @Override
     public Instruction deserializeHeader(ByteBuf input) {
-        input.skipBytes(2 * EncodeConstants.SIZE_OF_SHORT_IN_BYTES);
+        input.skipBytes(2 * Short.BYTES);
         return new InstructionBuilder().setInstructionChoice(new GotoTableCaseBuilder().build()).build();
     }
 }
index a8794861219f70eab8b9e351ea62bdfb7d1ca9ef..1f53a332089b3c1f8b555fc6a5b9583ebfdc23ff 100644 (file)
@@ -12,7 +12,6 @@ import static org.opendaylight.yangtools.yang.common.netty.ByteBufUtils.readUint
 import io.netty.buffer.ByteBuf;
 import org.opendaylight.openflowjava.protocol.api.extensibility.HeaderDeserializer;
 import org.opendaylight.openflowjava.protocol.api.extensibility.OFDeserializer;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.instruction.rev130731.instruction.grouping.instruction.choice.MeterCaseBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.instruction.rev130731.instruction.grouping.instruction.choice.meter._case.MeterBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.instruction.rev130731.instructions.grouping.Instruction;
@@ -25,10 +24,9 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.instruction
  */
 public class MeterInstructionDeserializer implements OFDeserializer<Instruction>,
         HeaderDeserializer<Instruction> {
-
     @Override
     public Instruction deserialize(ByteBuf input) {
-        input.skipBytes(2 * EncodeConstants.SIZE_OF_SHORT_IN_BYTES);
+        input.skipBytes(2 * Short.BYTES);
         return new InstructionBuilder()
                 .setInstructionChoice(new MeterCaseBuilder()
                     .setMeter(new MeterBuilder().setMeterId(readUint32(input)).build())
@@ -38,7 +36,7 @@ public class MeterInstructionDeserializer implements OFDeserializer<Instruction>
 
     @Override
     public Instruction deserializeHeader(ByteBuf input) {
-        input.skipBytes(2 * EncodeConstants.SIZE_OF_SHORT_IN_BYTES);
+        input.skipBytes(2 * Short.BYTES);
         return new InstructionBuilder().setInstructionChoice(new MeterCaseBuilder().build()).build();
     }
 }
index e54c1a948afdc02495ff3a7e5dd53a8a26f67c89..a09a27d61b5433d6fd24c97fcb6ca93aef6b3642 100644 (file)
@@ -5,12 +5,10 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowjava.protocol.impl.deserialization.instruction;
 
 import io.netty.buffer.ByteBuf;
 import org.opendaylight.openflowjava.protocol.api.extensibility.HeaderDeserializer;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.impl.util.InstructionConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.instruction.rev130731.instruction.grouping.instruction.choice.WriteActionsCaseBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.instruction.rev130731.instruction.grouping.instruction.choice.write.actions._case.WriteActionsBuilder;
@@ -24,11 +22,10 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.instruction
  */
 public class WriteActionsInstructionDeserializer extends AbstractActionInstructionDeserializer
         implements HeaderDeserializer<Instruction> {
-
     @Override
     public Instruction deserialize(ByteBuf input) {
         final InstructionBuilder builder = new InstructionBuilder();
-        input.skipBytes(EncodeConstants.SIZE_OF_SHORT_IN_BYTES);
+        input.skipBytes(Short.BYTES);
         int instructionLength = input.readUnsignedShort();
         input.skipBytes(InstructionConstants.PADDING_IN_ACTIONS_INSTRUCTION);
         WriteActionsCaseBuilder caseBuilder = new WriteActionsCaseBuilder();
@@ -42,9 +39,8 @@ public class WriteActionsInstructionDeserializer extends AbstractActionInstructi
     @Override
     public Instruction deserializeHeader(ByteBuf input) {
         InstructionBuilder builder = new InstructionBuilder();
-        input.skipBytes(2 * EncodeConstants.SIZE_OF_SHORT_IN_BYTES);
+        input.skipBytes(2 * Short.BYTES);
         builder.setInstructionChoice(new WriteActionsCaseBuilder().build());
         return builder.build();
     }
-
 }
index 5cd96423a6c02d01d9be02881dfba861990f214c..f395901423546a3d50efd5ec2100b0bfa25ae9f7 100644 (file)
@@ -5,13 +5,11 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowjava.protocol.impl.deserialization.instruction;
 
 import io.netty.buffer.ByteBuf;
 import org.opendaylight.openflowjava.protocol.api.extensibility.HeaderDeserializer;
 import org.opendaylight.openflowjava.protocol.api.extensibility.OFDeserializer;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.impl.util.InstructionConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.instruction.rev130731.instruction.grouping.instruction.choice.WriteMetadataCaseBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.instruction.rev130731.instruction.grouping.instruction.choice.write.metadata._case.WriteMetadataBuilder;
@@ -25,18 +23,17 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.instruction
  */
 public class WriteMetadataInstructionDeserializer implements OFDeserializer<Instruction>,
         HeaderDeserializer<Instruction> {
-
     @Override
     public Instruction deserialize(ByteBuf input) {
         final InstructionBuilder builder = new InstructionBuilder();
-        input.skipBytes(2 * EncodeConstants.SIZE_OF_SHORT_IN_BYTES);
+        input.skipBytes(2 * Short.BYTES);
         input.skipBytes(InstructionConstants.PADDING_IN_WRITE_METADATA);
         final WriteMetadataCaseBuilder caseBuilder = new WriteMetadataCaseBuilder();
         WriteMetadataBuilder metadataBuilder = new WriteMetadataBuilder();
-        byte[] metadata = new byte[EncodeConstants.SIZE_OF_LONG_IN_BYTES];
+        byte[] metadata = new byte[Long.BYTES];
         input.readBytes(metadata);
         metadataBuilder.setMetadata(metadata);
-        byte[] metadataMask = new byte[EncodeConstants.SIZE_OF_LONG_IN_BYTES];
+        byte[] metadataMask = new byte[Long.BYTES];
         input.readBytes(metadataMask);
         metadataBuilder.setMetadataMask(metadataMask);
         caseBuilder.setWriteMetadata(metadataBuilder.build());
@@ -47,7 +44,7 @@ public class WriteMetadataInstructionDeserializer implements OFDeserializer<Inst
     @Override
     public Instruction deserializeHeader(ByteBuf input) {
         InstructionBuilder builder = new InstructionBuilder();
-        input.skipBytes(2 * EncodeConstants.SIZE_OF_SHORT_IN_BYTES);
+        input.skipBytes(2 * Short.BYTES);
         builder.setInstructionChoice(new WriteMetadataCaseBuilder().build());
         return builder.build();
     }
index a9ed86cce1783e621a7ac3f23e75677cff36e64b..0fc13db683140937b997876b32fa6a4fa6a5a41c 100644 (file)
@@ -9,7 +9,6 @@ package org.opendaylight.openflowjava.protocol.impl.deserialization.match;
 
 import io.netty.buffer.ByteBuf;
 import org.opendaylight.openflowjava.protocol.api.extensibility.HeaderDeserializer;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.MatchField;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.OxmClassBase;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntry;
@@ -21,7 +20,6 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.matc
  * @author michal.polkorab
  */
 public abstract class AbstractOxmMatchEntryDeserializer implements HeaderDeserializer<MatchEntry> {
-
     @Override
     public MatchEntry deserializeHeader(ByteBuf input) {
         MatchEntryBuilder builder = processHeader(getOxmClass(), getOxmField(), input);
@@ -53,13 +51,12 @@ public abstract class AbstractOxmMatchEntryDeserializer implements HeaderDeseria
         MatchEntryBuilder builder = new MatchEntryBuilder();
         builder.setOxmClass(oxmClass);
         // skip oxm_class (provided)
-        input.skipBytes(EncodeConstants.SIZE_OF_SHORT_IN_BYTES);
+        input.skipBytes(Short.BYTES);
         builder.setOxmMatchField(oxmField);
         boolean hasMask = (input.readUnsignedByte() & 1) != 0;
         builder.setHasMask(hasMask);
         // skip match entry length - not needed
-        input.skipBytes(EncodeConstants.SIZE_OF_BYTE_IN_BYTES);
+        input.skipBytes(Byte.BYTES);
         return builder;
     }
-
 }
index 2c44a66ba03e481bec7ed553498addc4047a2cad..9444aa7118b9d78589fe1f340943e29045dd9d75 100644 (file)
@@ -9,7 +9,6 @@ package org.opendaylight.openflowjava.protocol.impl.deserialization.match;
 
 import io.netty.buffer.ByteBuf;
 import org.opendaylight.openflowjava.protocol.api.extensibility.OFDeserializer;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.Ipv6ExthdrFlags;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.Ipv6Exthdr;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.MatchField;
@@ -27,7 +26,6 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.matc
  */
 public class OxmIpv6ExtHdrDeserializer extends AbstractOxmMatchEntryDeserializer
         implements OFDeserializer<MatchEntry> {
-
     @Override
     public MatchEntry deserialize(ByteBuf input) {
         MatchEntryBuilder builder = processHeader(getOxmClass(), getOxmField(), input);
@@ -40,8 +38,7 @@ public class OxmIpv6ExtHdrDeserializer extends AbstractOxmMatchEntryDeserializer
         Ipv6ExthdrBuilder extHdrBuilder = new Ipv6ExthdrBuilder();
         extHdrBuilder.setPseudoField(convertPseudofields(input));
         if (builder.isHasMask()) {
-            extHdrBuilder.setMask(OxmDeserializerHelper
-                    .convertMask(input, EncodeConstants.SIZE_OF_SHORT_IN_BYTES));
+            extHdrBuilder.setMask(OxmDeserializerHelper.convertMask(input, Short.BYTES));
         }
         caseBuilder.setIpv6Exthdr(extHdrBuilder.build());
         builder.setMatchEntryValue(caseBuilder.build());
index b4e97196982246b3d798631880c85000739fb965..8d4672b232c2b6e696808f32a4716b072148ddbe 100644 (file)
@@ -11,7 +11,6 @@ import static org.opendaylight.yangtools.yang.common.netty.ByteBufUtils.readUint
 
 import io.netty.buffer.ByteBuf;
 import org.opendaylight.openflowjava.protocol.api.extensibility.OFDeserializer;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv6FlowLabel;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.Ipv6Flabel;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.MatchField;
@@ -29,7 +28,6 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.matc
  */
 public class OxmIpv6FlabelDeserializer extends AbstractOxmMatchEntryDeserializer
         implements OFDeserializer<MatchEntry> {
-
     @Override
     public MatchEntry deserialize(ByteBuf input) {
         MatchEntryBuilder builder = processHeader(getOxmClass(), getOxmField(), input);
@@ -42,8 +40,7 @@ public class OxmIpv6FlabelDeserializer extends AbstractOxmMatchEntryDeserializer
         Ipv6FlabelBuilder labelBuilder = new Ipv6FlabelBuilder();
         labelBuilder.setIpv6Flabel(new Ipv6FlowLabel(readUint32(input)));
         if (builder.isHasMask()) {
-            labelBuilder.setMask(OxmDeserializerHelper.convertMask(input,
-                    EncodeConstants.SIZE_OF_INT_IN_BYTES));
+            labelBuilder.setMask(OxmDeserializerHelper.convertMask(input, Integer.BYTES));
         }
         caseBuilder.setIpv6Flabel(labelBuilder.build());
         builder.setMatchEntryValue(caseBuilder.build());
@@ -58,5 +55,4 @@ public class OxmIpv6FlabelDeserializer extends AbstractOxmMatchEntryDeserializer
     protected Class<? extends OxmClassBase> getOxmClass() {
         return OpenflowBasicClass.class;
     }
-
 }
index d07ab5e69999906bf8b8879d5f4e702aed0d20ee..897be1086cdec48f6da86bae035c13feeedd5159 100644 (file)
@@ -9,7 +9,6 @@ package org.opendaylight.openflowjava.protocol.impl.deserialization.match;
 
 import io.netty.buffer.ByteBuf;
 import org.opendaylight.openflowjava.protocol.api.extensibility.OFDeserializer;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.MatchField;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.Metadata;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.OpenflowBasicClass;
@@ -37,12 +36,11 @@ public class OxmMetadataDeserializer  extends AbstractOxmMatchEntryDeserializer
     private static void addMetadataValue(ByteBuf input, MatchEntryBuilder builder) {
         final MetadataCaseBuilder caseBuilder = new MetadataCaseBuilder();
         MetadataBuilder metadataBuilder = new MetadataBuilder();
-        byte[] metadataBytes = new byte[EncodeConstants.SIZE_OF_LONG_IN_BYTES];
+        byte[] metadataBytes = new byte[Long.BYTES];
         input.readBytes(metadataBytes);
         metadataBuilder.setMetadata(metadataBytes);
         if (builder.isHasMask()) {
-            metadataBuilder.setMask(OxmDeserializerHelper
-                    .convertMask(input, EncodeConstants.SIZE_OF_LONG_IN_BYTES));
+            metadataBuilder.setMask(OxmDeserializerHelper.convertMask(input, Long.BYTES));
         }
         caseBuilder.setMetadata(metadataBuilder.build());
         builder.setMatchEntryValue(caseBuilder.build());
index 9a17aa7d58d2d74af633ef3f21d704d3dc1906a6..fd28b1db5286b86f53025d5ea262943787dc2b3d 100644 (file)
@@ -9,7 +9,6 @@ package org.opendaylight.openflowjava.protocol.impl.deserialization.match;
 
 import io.netty.buffer.ByteBuf;
 import org.opendaylight.openflowjava.protocol.api.extensibility.OFDeserializer;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.MatchField;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.OpenflowBasicClass;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.OxmClassBase;
@@ -37,12 +36,11 @@ public class OxmTunnelIdDeserializer extends AbstractOxmMatchEntryDeserializer
     private static void addTunnelIdValue(ByteBuf input, MatchEntryBuilder builder) {
         final TunnelIdCaseBuilder caseBuilder = new TunnelIdCaseBuilder();
         TunnelIdBuilder tunnelIdBuilder = new TunnelIdBuilder();
-        byte[] metadataBytes = new byte[EncodeConstants.SIZE_OF_LONG_IN_BYTES];
+        byte[] metadataBytes = new byte[Long.BYTES];
         input.readBytes(metadataBytes);
         tunnelIdBuilder.setTunnelId(metadataBytes);
         if (builder.isHasMask()) {
-            tunnelIdBuilder.setMask(OxmDeserializerHelper
-                    .convertMask(input, EncodeConstants.SIZE_OF_LONG_IN_BYTES));
+            tunnelIdBuilder.setMask(OxmDeserializerHelper.convertMask(input, Long.BYTES));
         }
         caseBuilder.setTunnelId(tunnelIdBuilder.build());
         builder.setMatchEntryValue(caseBuilder.build());
index b617180c97cf8f1ae1783cf4e602b1fde41c1234..0571b8d61ab7050b6c5cc0d8da80ba2d722728c7 100644 (file)
@@ -9,7 +9,6 @@ package org.opendaylight.openflowjava.protocol.impl.deserialization.match;
 
 import io.netty.buffer.ByteBuf;
 import org.opendaylight.openflowjava.protocol.api.extensibility.OFDeserializer;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.MatchField;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.OpenflowBasicClass;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.OxmClassBase;
@@ -27,7 +26,6 @@ import org.opendaylight.yangtools.yang.common.Uint16;
  */
 public class OxmVlanVidDeserializer extends AbstractOxmMatchEntryDeserializer
         implements OFDeserializer<MatchEntry> {
-
     @Override
     public MatchEntry deserialize(ByteBuf input) {
         MatchEntryBuilder builder = processHeader(getOxmClass(), getOxmField(), input);
@@ -42,8 +40,7 @@ public class OxmVlanVidDeserializer extends AbstractOxmMatchEntryDeserializer
         vlanBuilder.setCfiBit((vidEntryValue & 1 << 12) != 0); // cfi is 13-th bit
         vlanBuilder.setVlanVid(Uint16.valueOf(vidEntryValue & (1 << 12) - 1)); // value without 13-th bit
         if (builder.isHasMask()) {
-            vlanBuilder.setMask(OxmDeserializerHelper
-                    .convertMask(input, EncodeConstants.SIZE_OF_SHORT_IN_BYTES));
+            vlanBuilder.setMask(OxmDeserializerHelper.convertMask(input, Short.BYTES));
         }
         caseBuilder.setVlanVid(vlanBuilder.build());
         builder.setMatchEntryValue(caseBuilder.build());
index 4e1a85d842b0491ca4df73167b56c5f991c0a0ab..de375227e68f1665bec605531ac3becb8063643b 100644 (file)
@@ -11,7 +11,6 @@ import static org.opendaylight.yangtools.yang.common.netty.ByteBufUtils.readUint
 
 import io.netty.buffer.ByteBuf;
 import org.opendaylight.openflowjava.protocol.api.extensibility.OFDeserializer;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.approved.extensions.rev160802.TcpFlags;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.approved.extensions.rev160802.TcpFlagsContainerBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.approved.extensions.rev160802.oxm.container.match.entry.value.experimenter.id._case.TcpFlagsBuilder;
@@ -27,7 +26,6 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.matc
  */
 public class OnfOxmTcpFlagsDeserializer extends AbstractOxmExperimenterMatchEntryDeserializer
         implements OFDeserializer<MatchEntry> {
-
     @Override
     public MatchEntry deserialize(ByteBuf input) {
         MatchEntryBuilder matchEntryBuilder = new MatchEntryBuilder(deserializeHeader(input));
@@ -43,7 +41,7 @@ public class OnfOxmTcpFlagsDeserializer extends AbstractOxmExperimenterMatchEntr
         TcpFlagsBuilder flagsBuilder = new TcpFlagsBuilder();
         flagsBuilder.setFlags(readUint16(input));
         if (hasMask) {
-            byte[] mask = new byte[EncodeConstants.SIZE_OF_SHORT_IN_BYTES];
+            byte[] mask = new byte[Short.BYTES];
             input.readBytes(mask);
             flagsBuilder.setMask(mask);
         }
index d79b620f046ff3a4f5567bc91dd080e093607a0d..9955587a9da5bf06ad378186dba1a97ef3334941 100644 (file)
@@ -8,7 +8,6 @@
 package org.opendaylight.openflowjava.protocol.impl.serialization.match;
 
 import io.netty.buffer.ByteBuf;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntry;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.ArpOpCase;
@@ -19,7 +18,6 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.matc
  * @author michal.polkorab
  */
 public class OxmArpOpSerializer extends AbstractOxmMatchEntrySerializer {
-
     @Override
     public void serialize(MatchEntry entry, ByteBuf outBuffer) {
         super.serialize(entry, outBuffer);
@@ -39,6 +37,6 @@ public class OxmArpOpSerializer extends AbstractOxmMatchEntrySerializer {
 
     @Override
     protected int getValueLength() {
-        return EncodeConstants.SIZE_OF_SHORT_IN_BYTES;
+        return Short.BYTES;
     }
 }
index f84edab3e4f184500d136d7008cf83a11dde37b5..a2fc20ff112a9bfce2cfb929c31a5c2569b110bd 100644 (file)
@@ -43,6 +43,6 @@ public class OxmArpSpaSerializer extends AbstractOxmIpv4AddressSerializer {
 
     @Override
     protected int getValueLength() {
-        return EncodeConstants.SIZE_OF_INT_IN_BYTES;
+        return Integer.BYTES;
     }
 }
index e5e50c95341479bfc58925eff8cc236fbdf40460..94d3a7fb63da34d5a9809f38e26f9fa1caf91d63 100644 (file)
@@ -43,6 +43,6 @@ public class OxmArpTpaSerializer extends AbstractOxmIpv4AddressSerializer {
 
     @Override
     protected int getValueLength() {
-        return EncodeConstants.SIZE_OF_INT_IN_BYTES;
+        return Integer.BYTES;
     }
 }
index 69b1426bcd7ecb0aca2f8579e986052f20779591..bef7e07f3da9b73948767571776ba2ba6232955b 100644 (file)
@@ -8,7 +8,6 @@
 package org.opendaylight.openflowjava.protocol.impl.serialization.match;
 
 import io.netty.buffer.ByteBuf;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntry;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.EthTypeCase;
@@ -39,6 +38,6 @@ public class OxmEthTypeSerializer extends AbstractOxmMatchEntrySerializer {
 
     @Override
     protected int getValueLength() {
-        return EncodeConstants.SIZE_OF_SHORT_IN_BYTES;
+        return Short.BYTES;
     }
 }
index 52b499390259191c6a87aa195351ed696f7f8707..3ebc54bafb7bc756554a1314feba83155bc7b767 100644 (file)
@@ -8,7 +8,6 @@
 package org.opendaylight.openflowjava.protocol.impl.serialization.match;
 
 import io.netty.buffer.ByteBuf;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntry;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.Icmpv4CodeCase;
@@ -19,7 +18,6 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.matc
  * @author michal.polkorab
  */
 public class OxmIcmpv4CodeSerializer extends AbstractOxmMatchEntrySerializer {
-
     @Override
     public void serialize(MatchEntry entry, ByteBuf outBuffer) {
         super.serialize(entry, outBuffer);
@@ -39,6 +37,6 @@ public class OxmIcmpv4CodeSerializer extends AbstractOxmMatchEntrySerializer {
 
     @Override
     protected int getValueLength() {
-        return EncodeConstants.SIZE_OF_BYTE_IN_BYTES;
+        return Byte.BYTES;
     }
 }
index 03c0baf1a5846bf0e8370af34ddd3e8bc15142cd..9d3803ae2b97c3359527b63dd2ba38abf3256daf 100644 (file)
@@ -8,7 +8,6 @@
 package org.opendaylight.openflowjava.protocol.impl.serialization.match;
 
 import io.netty.buffer.ByteBuf;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntry;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.Icmpv4TypeCase;
@@ -19,7 +18,6 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.matc
  * @author michal.polkorab
  */
 public class OxmIcmpv4TypeSerializer extends AbstractOxmMatchEntrySerializer {
-
     @Override
     public void serialize(MatchEntry entry, ByteBuf outBuffer) {
         super.serialize(entry, outBuffer);
@@ -39,6 +37,6 @@ public class OxmIcmpv4TypeSerializer extends AbstractOxmMatchEntrySerializer {
 
     @Override
     protected int getValueLength() {
-        return EncodeConstants.SIZE_OF_BYTE_IN_BYTES;
+        return Byte.BYTES;
     }
 }
index e3618f801ac40fb06db38490a42dac50a5adc40d..998ae90a10c97cc9402d1f61738622ffe602d0cc 100644 (file)
@@ -8,7 +8,6 @@
 package org.opendaylight.openflowjava.protocol.impl.serialization.match;
 
 import io.netty.buffer.ByteBuf;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntry;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.Icmpv6CodeCase;
@@ -19,7 +18,6 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.matc
  * @author michal.polkorab
  */
 public class OxmIcmpv6CodeSerializer extends AbstractOxmMatchEntrySerializer {
-
     @Override
     public void serialize(MatchEntry entry, ByteBuf outBuffer) {
         super.serialize(entry, outBuffer);
@@ -39,6 +37,6 @@ public class OxmIcmpv6CodeSerializer extends AbstractOxmMatchEntrySerializer {
 
     @Override
     protected int getValueLength() {
-        return EncodeConstants.SIZE_OF_BYTE_IN_BYTES;
+        return Byte.BYTES;
     }
 }
index 53af421722b1ef4d8e157388fc8d3cc6c6a6049a..90eee03c6d35dc06e66355f64a367420e40acca3 100644 (file)
@@ -8,7 +8,6 @@
 package org.opendaylight.openflowjava.protocol.impl.serialization.match;
 
 import io.netty.buffer.ByteBuf;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntry;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.Icmpv6TypeCase;
@@ -19,7 +18,6 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.matc
  * @author michal.polkorab
  */
 public class OxmIcmpv6TypeSerializer extends AbstractOxmMatchEntrySerializer {
-
     @Override
     public void serialize(MatchEntry entry, ByteBuf outBuffer) {
         super.serialize(entry, outBuffer);
@@ -39,6 +37,6 @@ public class OxmIcmpv6TypeSerializer extends AbstractOxmMatchEntrySerializer {
 
     @Override
     protected int getValueLength() {
-        return EncodeConstants.SIZE_OF_BYTE_IN_BYTES;
+        return Byte.BYTES;
     }
 }
index db78b36f3a0628fd8f275f50232b1199c998a5ad..5b88cc6dbece9b7445eecdb7b5b7afdb4703940e 100644 (file)
@@ -8,7 +8,6 @@
 package org.opendaylight.openflowjava.protocol.impl.serialization.match;
 
 import io.netty.buffer.ByteBuf;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntry;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.InPhyPortCase;
@@ -19,7 +18,6 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.matc
  * @author michal.polkorab
  */
 public class OxmInPhyPortSerializer extends AbstractOxmMatchEntrySerializer {
-
     @Override
     public void serialize(MatchEntry entry, ByteBuf outBuffer) {
         super.serialize(entry, outBuffer);
@@ -39,6 +37,6 @@ public class OxmInPhyPortSerializer extends AbstractOxmMatchEntrySerializer {
 
     @Override
     protected int getValueLength() {
-        return EncodeConstants.SIZE_OF_INT_IN_BYTES;
+        return Integer.BYTES;
     }
 }
index f8edfbdcaa67aa06e83214ddf3ebbdfc282f96c7..3a00f0cf589fa012a39a01e664b35884374f4c77 100644 (file)
@@ -8,7 +8,6 @@
 package org.opendaylight.openflowjava.protocol.impl.serialization.match;
 
 import io.netty.buffer.ByteBuf;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntry;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.InPortCase;
@@ -19,7 +18,6 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.matc
  * @author michal.polkorab
  */
 public class OxmInPortSerializer extends AbstractOxmMatchEntrySerializer {
-
     @Override
     public void serialize(MatchEntry entry, ByteBuf outBuffer) {
         super.serialize(entry, outBuffer);
@@ -39,6 +37,6 @@ public class OxmInPortSerializer extends AbstractOxmMatchEntrySerializer {
 
     @Override
     protected int getValueLength() {
-        return EncodeConstants.SIZE_OF_INT_IN_BYTES;
+        return Integer.BYTES;
     }
 }
index 730ce0edf7e5c3c56d5846b618a46f5960716c5d..e144003cdec600951afc35eeeeb3ba4373a27f82 100644 (file)
@@ -8,7 +8,6 @@
 package org.opendaylight.openflowjava.protocol.impl.serialization.match;
 
 import io.netty.buffer.ByteBuf;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntry;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.IpDscpCase;
@@ -19,7 +18,6 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.matc
  * @author michal.polkorab
  */
 public class OxmIpDscpSerializer extends AbstractOxmMatchEntrySerializer {
-
     @Override
     public void serialize(MatchEntry entry, ByteBuf outBuffer) {
         super.serialize(entry, outBuffer);
@@ -39,6 +37,6 @@ public class OxmIpDscpSerializer extends AbstractOxmMatchEntrySerializer {
 
     @Override
     protected int getValueLength() {
-        return EncodeConstants.SIZE_OF_BYTE_IN_BYTES;
+        return Byte.BYTES;
     }
 }
index 15a189310c93e24e7cf316a2aa59438a2dc43e59..22eed72310e6dd05d3e570cf3d13e0ef015f61b7 100644 (file)
@@ -8,7 +8,6 @@
 package org.opendaylight.openflowjava.protocol.impl.serialization.match;
 
 import io.netty.buffer.ByteBuf;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntry;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.IpEcnCase;
@@ -39,6 +38,6 @@ public class OxmIpEcnSerializer extends AbstractOxmMatchEntrySerializer {
 
     @Override
     protected int getValueLength() {
-        return EncodeConstants.SIZE_OF_BYTE_IN_BYTES;
+        return Byte.BYTES;
     }
 }
index 5dead166a16d1bcb07b795e1ed06e33d57bc348b..dbc2e132c54570c1dd6e310de0d923f38ccd20c5 100644 (file)
@@ -8,7 +8,6 @@
 package org.opendaylight.openflowjava.protocol.impl.serialization.match;
 
 import io.netty.buffer.ByteBuf;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntry;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.IpProtoCase;
@@ -19,7 +18,6 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.matc
  * @author michal.polkorab
  */
 public class OxmIpProtoSerializer extends AbstractOxmMatchEntrySerializer {
-
     @Override
     public void serialize(MatchEntry entry, ByteBuf outBuffer) {
         super.serialize(entry, outBuffer);
@@ -39,6 +37,6 @@ public class OxmIpProtoSerializer extends AbstractOxmMatchEntrySerializer {
 
     @Override
     protected int getValueLength() {
-        return EncodeConstants.SIZE_OF_BYTE_IN_BYTES;
+        return Byte.BYTES;
     }
 }
index 8eb09c41db2394dfe5665fa81278ccb4364398d5..4e703bac6b21cfc1efc2e1363c80f9930c577f74 100644 (file)
@@ -43,6 +43,6 @@ public class OxmIpv4DstSerializer extends AbstractOxmIpv4AddressSerializer {
 
     @Override
     protected int getValueLength() {
-        return EncodeConstants.SIZE_OF_INT_IN_BYTES;
+        return Integer.BYTES;
     }
 }
index 02a7de94dea01b46e1295ab23e7b9c7285227dab..258b403f21ec766aed408b60e337a82230ef89ce 100644 (file)
@@ -43,6 +43,6 @@ public class OxmIpv4SrcSerializer extends AbstractOxmIpv4AddressSerializer {
 
     @Override
     protected int getValueLength() {
-        return EncodeConstants.SIZE_OF_INT_IN_BYTES;
+        return Integer.BYTES;
     }
 }
index 3def20cff5e9e8bf999e92022838f7d4bc7be022..b97e2236b64b97661a864a6113ac7cddbc5e0e02 100644 (file)
@@ -8,7 +8,6 @@
 package org.opendaylight.openflowjava.protocol.impl.serialization.match;
 
 import io.netty.buffer.ByteBuf;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 import org.opendaylight.openflowjava.util.ByteBufUtils;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.Ipv6ExthdrFlags;
@@ -21,7 +20,6 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.matc
  * @author michal.polkorab
  */
 public class OxmIpv6ExtHdrSerializer extends AbstractOxmMatchEntrySerializer {
-
     @Override
     public void serialize(MatchEntry entry, ByteBuf outBuffer) {
         super.serialize(entry, outBuffer);
@@ -55,6 +53,6 @@ public class OxmIpv6ExtHdrSerializer extends AbstractOxmMatchEntrySerializer {
 
     @Override
     protected int getValueLength() {
-        return EncodeConstants.SIZE_OF_SHORT_IN_BYTES;
+        return Short.BYTES;
     }
 }
index bfb04120a42c5984452c9d3dd2e3fc89c46dd810..8c89fe047405bf7de298a2a659b87deea3b90495 100644 (file)
@@ -8,7 +8,6 @@
 package org.opendaylight.openflowjava.protocol.impl.serialization.match;
 
 import io.netty.buffer.ByteBuf;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntry;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.Ipv6FlabelCase;
@@ -19,14 +18,13 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.matc
  * @author michal.polkorab
  */
 public class OxmIpv6FlabelSerializer extends AbstractOxmMatchEntrySerializer {
-
     @Override
     public void serialize(MatchEntry entry, ByteBuf outBuffer) {
         super.serialize(entry, outBuffer);
         Ipv6FlabelCase entryValue = (Ipv6FlabelCase) entry.getMatchEntryValue();
         outBuffer.writeInt(entryValue.getIpv6Flabel().getIpv6Flabel().getValue().intValue());
         if (entry.isHasMask()) {
-            writeMask(entryValue.getIpv6Flabel().getMask(), outBuffer, EncodeConstants.SIZE_OF_INT_IN_BYTES);
+            writeMask(entryValue.getIpv6Flabel().getMask(), outBuffer, Integer.BYTES);
         }
     }
 
@@ -42,6 +40,6 @@ public class OxmIpv6FlabelSerializer extends AbstractOxmMatchEntrySerializer {
 
     @Override
     protected int getValueLength() {
-        return EncodeConstants.SIZE_OF_INT_IN_BYTES;
+        return Integer.BYTES;
     }
 }
index 6beddfe468c64558880feff7261ddb203983ff0d..89162bef8b873f637b4eaba51c7b0bea03e7648e 100644 (file)
@@ -8,7 +8,6 @@
 package org.opendaylight.openflowjava.protocol.impl.serialization.match;
 
 import io.netty.buffer.ByteBuf;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntry;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.MetadataCase;
@@ -19,15 +18,13 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.matc
  * @author michal.polkorab
  */
 public class OxmMetadataSerializer extends AbstractOxmMatchEntrySerializer {
-
     @Override
     public void serialize(MatchEntry entry, ByteBuf outBuffer) {
         super.serialize(entry, outBuffer);
         MetadataCase entryValue = (MetadataCase) entry.getMatchEntryValue();
         outBuffer.writeBytes(entryValue.getMetadata().getMetadata());
         if (entry.isHasMask()) {
-            writeMask(entryValue.getMetadata().getMask(), outBuffer,
-                    EncodeConstants.SIZE_OF_LONG_IN_BYTES);
+            writeMask(entryValue.getMetadata().getMask(), outBuffer, Long.BYTES);
         }
     }
 
@@ -43,6 +40,6 @@ public class OxmMetadataSerializer extends AbstractOxmMatchEntrySerializer {
 
     @Override
     protected int getValueLength() {
-        return EncodeConstants.SIZE_OF_LONG_IN_BYTES;
+        return Long.BYTES;
     }
 }
index c0bff546a809da554d3c3a8621f2f72a10d47ff4..003871d3ea2347ea8b76fbe7c124cbdcb7f7d855 100644 (file)
@@ -8,7 +8,6 @@
 package org.opendaylight.openflowjava.protocol.impl.serialization.match;
 
 import io.netty.buffer.ByteBuf;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntry;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.MplsBosCase;
@@ -19,7 +18,6 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.matc
  * @author michal.polkorab
  */
 public class OxmMplsBosSerializer extends AbstractOxmMatchEntrySerializer {
-
     @Override
     public void serialize(MatchEntry entry, ByteBuf outBuffer) {
         super.serialize(entry, outBuffer);
@@ -39,6 +37,6 @@ public class OxmMplsBosSerializer extends AbstractOxmMatchEntrySerializer {
 
     @Override
     protected int getValueLength() {
-        return EncodeConstants.SIZE_OF_BYTE_IN_BYTES;
+        return Byte.BYTES;
     }
 }
index 2b6812b81a48ab70ad7461387918828362f91fac..dd71bc8cb0ae8b12fb49c872a768d2bf5a3b96c4 100644 (file)
@@ -8,7 +8,6 @@
 package org.opendaylight.openflowjava.protocol.impl.serialization.match;
 
 import io.netty.buffer.ByteBuf;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntry;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.MplsLabelCase;
@@ -19,7 +18,6 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.matc
  * @author michal.polkorab
  */
 public class OxmMplsLabelSerializer extends AbstractOxmMatchEntrySerializer {
-
     @Override
     public void serialize(MatchEntry entry, ByteBuf outBuffer) {
         super.serialize(entry, outBuffer);
@@ -39,6 +37,6 @@ public class OxmMplsLabelSerializer extends AbstractOxmMatchEntrySerializer {
 
     @Override
     protected int getValueLength() {
-        return EncodeConstants.SIZE_OF_INT_IN_BYTES;
+        return Integer.BYTES;
     }
 }
index c710af90e4783554f7a60385e5114f8e8782b7c4..82bf2d7569ecaccd1a6bba167e01210090f33bb9 100644 (file)
@@ -8,7 +8,6 @@
 package org.opendaylight.openflowjava.protocol.impl.serialization.match;
 
 import io.netty.buffer.ByteBuf;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntry;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.MplsTcCase;
@@ -19,7 +18,6 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.matc
  * @author michal.polkorab
  */
 public class OxmMplsTcSerializer extends AbstractOxmMatchEntrySerializer {
-
     @Override
     public void serialize(MatchEntry entry, ByteBuf outBuffer) {
         super.serialize(entry, outBuffer);
@@ -39,6 +37,6 @@ public class OxmMplsTcSerializer extends AbstractOxmMatchEntrySerializer {
 
     @Override
     protected int getValueLength() {
-        return EncodeConstants.SIZE_OF_BYTE_IN_BYTES;
+        return Byte.BYTES;
     }
 }
index e401d429482a5a44c6be9f009cd122d061354025..d6a1470bbe96f314b00b03a0becd8bbc3024047d 100644 (file)
@@ -5,17 +5,14 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowjava.protocol.impl.serialization.match;
 
 import io.netty.buffer.ByteBuf;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntry;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.PacketTypeCase;
 
 public class OxmPacketTypeSerializer extends AbstractOxmMatchEntrySerializer {
-
     @Override
     public void serialize(MatchEntry entry, ByteBuf outBuffer) {
         super.serialize(entry, outBuffer);
@@ -35,6 +32,6 @@ public class OxmPacketTypeSerializer extends AbstractOxmMatchEntrySerializer {
 
     @Override
     protected int getValueLength() {
-        return EncodeConstants.SIZE_OF_INT_IN_BYTES;
+        return Integer.BYTES;
     }
 }
index c05dd953a4fc1af6a07562c0ee6fd08982a3b255..6315ab4af981e92354645db040b726296e9d1404 100644 (file)
@@ -8,7 +8,6 @@
 package org.opendaylight.openflowjava.protocol.impl.serialization.match;
 
 import io.netty.buffer.ByteBuf;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntry;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.SctpDstCase;
@@ -19,7 +18,6 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.matc
  * @author michal.polkorab
  */
 public class OxmSctpDstSerializer extends AbstractOxmMatchEntrySerializer {
-
     @Override
     public void serialize(MatchEntry entry, ByteBuf outBuffer) {
         super.serialize(entry, outBuffer);
@@ -39,6 +37,6 @@ public class OxmSctpDstSerializer extends AbstractOxmMatchEntrySerializer {
 
     @Override
     protected int getValueLength() {
-        return EncodeConstants.SIZE_OF_SHORT_IN_BYTES;
+        return Short.BYTES;
     }
 }
index 75af1323d109c99b899e37f00d15717c6973d8dc..2c0291b110e241e0ee9641f45966751950282b85 100644 (file)
@@ -8,7 +8,6 @@
 package org.opendaylight.openflowjava.protocol.impl.serialization.match;
 
 import io.netty.buffer.ByteBuf;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntry;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.SctpSrcCase;
@@ -39,6 +38,6 @@ public class OxmSctpSrcSerializer extends AbstractOxmMatchEntrySerializer {
 
     @Override
     protected int getValueLength() {
-        return EncodeConstants.SIZE_OF_SHORT_IN_BYTES;
+        return Short.BYTES;
     }
 }
index 33dcbf7052fb5a8e24c63d25ada8e8aff6eb26b9..8363334bb6bb5e5a830867af5ef287d90e1001c7 100644 (file)
@@ -8,7 +8,6 @@
 package org.opendaylight.openflowjava.protocol.impl.serialization.match;
 
 import io.netty.buffer.ByteBuf;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntry;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.TcpDstCase;
@@ -19,7 +18,6 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.matc
  * @author michal.polkorab
  */
 public class OxmTcpDstSerializer extends AbstractOxmMatchEntrySerializer {
-
     @Override
     public void serialize(MatchEntry entry, ByteBuf outBuffer) {
         super.serialize(entry, outBuffer);
@@ -39,6 +37,6 @@ public class OxmTcpDstSerializer extends AbstractOxmMatchEntrySerializer {
 
     @Override
     protected int getValueLength() {
-        return EncodeConstants.SIZE_OF_SHORT_IN_BYTES;
+        return Short.BYTES;
     }
 }
index 452368d4e4102c9cb7e86b6fd87dc7f45d393658..094e4bec8815234d2e6fc89f2a352acea1caa483 100644 (file)
@@ -8,7 +8,6 @@
 package org.opendaylight.openflowjava.protocol.impl.serialization.match;
 
 import io.netty.buffer.ByteBuf;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntry;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.TcpSrcCase;
@@ -19,7 +18,6 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.matc
  * @author michal.polkorab
  */
 public class OxmTcpSrcSerializer extends AbstractOxmMatchEntrySerializer {
-
     @Override
     public void serialize(MatchEntry entry, ByteBuf outBuffer) {
         super.serialize(entry, outBuffer);
@@ -39,6 +37,6 @@ public class OxmTcpSrcSerializer extends AbstractOxmMatchEntrySerializer {
 
     @Override
     protected int getValueLength() {
-        return EncodeConstants.SIZE_OF_SHORT_IN_BYTES;
+        return Short.BYTES;
     }
 }
index 3c1eea9893392f41e916b5493c84ce190eef07cc..eebadc457f420e5f495baed6b5c06eb29cb33c10 100644 (file)
@@ -8,7 +8,6 @@
 package org.opendaylight.openflowjava.protocol.impl.serialization.match;
 
 import io.netty.buffer.ByteBuf;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntry;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.TunnelIdCase;
@@ -19,15 +18,13 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.matc
  * @author michal.polkorab
  */
 public class OxmTunnelIdSerializer extends AbstractOxmMatchEntrySerializer {
-
     @Override
     public void serialize(MatchEntry entry, ByteBuf outBuffer) {
         super.serialize(entry, outBuffer);
         TunnelIdCase entryValue = (TunnelIdCase) entry.getMatchEntryValue();
         outBuffer.writeBytes(entryValue.getTunnelId().getTunnelId());
         if (entry.isHasMask()) {
-            writeMask(entryValue.getTunnelId().getMask(), outBuffer,
-                    EncodeConstants.SIZE_OF_LONG_IN_BYTES);
+            writeMask(entryValue.getTunnelId().getMask(), outBuffer, Long.BYTES);
         }
     }
 
@@ -43,6 +40,6 @@ public class OxmTunnelIdSerializer extends AbstractOxmMatchEntrySerializer {
 
     @Override
     protected int getValueLength() {
-        return EncodeConstants.SIZE_OF_LONG_IN_BYTES;
+        return Long.BYTES;
     }
 }
index 03f62a7802dbf593f9bfc33936abb9ba2a62b699..c0a66f84be6a37282c148d3b190372644519565b 100644 (file)
@@ -8,7 +8,6 @@
 package org.opendaylight.openflowjava.protocol.impl.serialization.match;
 
 import io.netty.buffer.ByteBuf;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntry;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.UdpDstCase;
@@ -19,7 +18,6 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.matc
  * @author michal.polkorab
  */
 public class OxmUdpDstSerializer extends AbstractOxmMatchEntrySerializer {
-
     @Override
     public void serialize(MatchEntry entry, ByteBuf outBuffer) {
         super.serialize(entry, outBuffer);
@@ -39,6 +37,6 @@ public class OxmUdpDstSerializer extends AbstractOxmMatchEntrySerializer {
 
     @Override
     protected int getValueLength() {
-        return EncodeConstants.SIZE_OF_SHORT_IN_BYTES;
+        return Short.BYTES;
     }
 }
index 91e1d5332b962dd40c52843f2f5f012be52f37a1..5cefd686fa502bc225c86f099843398401ad6e14 100644 (file)
@@ -8,7 +8,6 @@
 package org.opendaylight.openflowjava.protocol.impl.serialization.match;
 
 import io.netty.buffer.ByteBuf;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntry;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.UdpSrcCase;
@@ -19,7 +18,6 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.matc
  * @author michal.polkorab
  */
 public class OxmUdpSrcSerializer extends AbstractOxmMatchEntrySerializer {
-
     @Override
     public void serialize(MatchEntry entry, ByteBuf outBuffer) {
         super.serialize(entry, outBuffer);
@@ -39,7 +37,6 @@ public class OxmUdpSrcSerializer extends AbstractOxmMatchEntrySerializer {
 
     @Override
     protected int getValueLength() {
-        return EncodeConstants.SIZE_OF_SHORT_IN_BYTES;
+        return Short.BYTES;
     }
-
 }
index 4e50eec0149429b5f086c2c7442d09f920462115..efbd25978d9a802c8f94cabb578b18ea4dcb8c8d 100644 (file)
@@ -8,7 +8,6 @@
 package org.opendaylight.openflowjava.protocol.impl.serialization.match;
 
 import io.netty.buffer.ByteBuf;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntry;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.VlanPcpCase;
@@ -19,7 +18,6 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.matc
  * @author michal.polkorab
  */
 public class OxmVlanPcpSerializer extends AbstractOxmMatchEntrySerializer {
-
     @Override
     public void serialize(MatchEntry entry, ByteBuf outBuffer) {
         super.serialize(entry, outBuffer);
@@ -39,7 +37,6 @@ public class OxmVlanPcpSerializer extends AbstractOxmMatchEntrySerializer {
 
     @Override
     protected int getValueLength() {
-        return EncodeConstants.SIZE_OF_BYTE_IN_BYTES;
+        return Byte.BYTES;
     }
-
 }
index 74579e9b84451cec9a849d0c6045e4c6c4e85f21..1f18a549177b856dfc767cf089bea7955c029d3f 100644 (file)
@@ -8,7 +8,6 @@
 package org.opendaylight.openflowjava.protocol.impl.serialization.match;
 
 import io.netty.buffer.ByteBuf;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntry;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.VlanVidCase;
@@ -20,7 +19,6 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.matc
  * @author michal.polkorab
  */
 public class OxmVlanVidSerializer extends AbstractOxmMatchEntrySerializer {
-
     @Override
     public void serialize(MatchEntry entry, ByteBuf outBuffer) {
         super.serialize(entry, outBuffer);
@@ -48,7 +46,6 @@ public class OxmVlanVidSerializer extends AbstractOxmMatchEntrySerializer {
 
     @Override
     protected int getValueLength() {
-        return EncodeConstants.SIZE_OF_SHORT_IN_BYTES;
+        return Short.BYTES;
     }
-
 }
index 61654423d16df97fd723a5eae220737d3821e85e..6dc9e87ebecee40ac7eeecdac4ad8d2ea7bd3f32 100644 (file)
@@ -8,7 +8,6 @@
 package org.opendaylight.openflowjava.protocol.impl.serialization.match.ext;
 
 import io.netty.buffer.ByteBuf;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.impl.serialization.match.AbstractOxmMatchEntrySerializer;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.oxm.container.match.entry.value.ExperimenterIdCase;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntry;
@@ -18,7 +17,6 @@ import org.opendaylight.yangtools.yang.common.Uint32;
  * Created by Anil Vishnoi (avishnoi@Brocade.com) on 7/25/16.
  */
 public abstract class AbstractOxmExperimenterMatchEntrySerializer extends AbstractOxmMatchEntrySerializer {
-
     @Override
     public void serialize(final MatchEntry entry, final ByteBuf outBuffer) {
         serializeHeader(entry, outBuffer);
@@ -40,7 +38,7 @@ public abstract class AbstractOxmExperimenterMatchEntrySerializer extends Abstra
         }
 
         //Add experimenter-id lenge
-        length = length + EncodeConstants.SIZE_OF_INT_IN_BYTES;
+        length = length + Integer.BYTES;
         out.writeByte(fieldAndMask);
         out.writeByte(length);
     }
index e8685541a26912018f55a516b60e6efb16a4290f..a0c5daf0d677e9f61f8ea06c411dd36d3f9c8e22 100644 (file)
@@ -61,6 +61,6 @@ public class OnfOxmTcpFlagsSerializer extends AbstractOxmExperimenterMatchEntryS
      */
     @Override
     protected int getValueLength() {
-        return EncodeConstants.SIZE_OF_SHORT_IN_BYTES;
+        return Short.BYTES;
     }
 }
index a86f42ad83b89858862be45bbf55d30cb1f740c9..85337cbfef28387ba8a5130297ff0a5b5b70dab1 100644 (file)
@@ -34,13 +34,11 @@ public final class CodeKeyMakerFactory {
             @Override
             public MessageCodeKey make(final ByteBuf input) {
                 int oxmClass = input.getUnsignedShort(input.readerIndex());
-                int oxmField = input.getUnsignedByte(input.readerIndex()
-                        + EncodeConstants.SIZE_OF_SHORT_IN_BYTES) >>> 1;
+                int oxmField = input.getUnsignedByte(input.readerIndex() + Short.BYTES) >>> 1;
                 MatchEntryDeserializerKey key = new MatchEntryDeserializerKey(getVersion(),
                         oxmClass, oxmField);
                 if (oxmClass == EncodeConstants.EXPERIMENTER_VALUE) {
-                    long expId = input.getUnsignedInt(input.readerIndex() + EncodeConstants.SIZE_OF_SHORT_IN_BYTES
-                            + 2 * EncodeConstants.SIZE_OF_BYTE_IN_BYTES);
+                    long expId = input.getUnsignedInt(input.readerIndex() + Short.BYTES + 2 * Byte.BYTES);
                     key.setExperimenterId(Uint32.valueOf(expId));
                     return key;
                 }
@@ -56,8 +54,7 @@ public final class CodeKeyMakerFactory {
             public MessageCodeKey make(final ByteBuf input) {
                 int type = input.getUnsignedShort(input.readerIndex());
                 if (type == EncodeConstants.EXPERIMENTER_VALUE) {
-                    Long expId = input.getUnsignedInt(input.readerIndex()
-                            + 2 * EncodeConstants.SIZE_OF_SHORT_IN_BYTES);
+                    Long expId = input.getUnsignedInt(input.readerIndex() + 2 * Short.BYTES);
                     return new ExperimenterActionDeserializerKey(getVersion(), expId);
                 }
                 ActionDeserializerKey actionDeserializerKey = new ActionDeserializerKey(getVersion(), type, null);
@@ -72,8 +69,7 @@ public final class CodeKeyMakerFactory {
             public MessageCodeKey make(final ByteBuf input) {
                 int type = input.getUnsignedShort(input.readerIndex());
                 if (type == EncodeConstants.EXPERIMENTER_VALUE) {
-                    Long expId = input.getUnsignedInt(input.readerIndex()
-                            + 2 * EncodeConstants.SIZE_OF_SHORT_IN_BYTES);
+                    Long expId = input.getUnsignedInt(input.readerIndex() + 2 * Short.BYTES);
                     return new ExperimenterInstructionDeserializerKey(getVersion(), expId);
                 }
                 return new InstructionDeserializerKey(getVersion(), type, null);
index a3043d4521e0a61da75e1a747f52b1f294778f27..5a6d25619ccecbe5849928198b49d3b5930a0870 100644 (file)
@@ -5,7 +5,6 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowjava.protocol.impl.util;
 
 import io.netty.buffer.ByteBuf;
@@ -15,7 +14,6 @@ import org.opendaylight.openflowjava.protocol.api.extensibility.DeserializerRegi
 import org.opendaylight.openflowjava.protocol.api.extensibility.HeaderDeserializer;
 import org.opendaylight.openflowjava.protocol.api.extensibility.OFDeserializer;
 import org.opendaylight.openflowjava.protocol.api.keys.MessageCodeKey;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.yangtools.yang.binding.DataObject;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -95,7 +93,7 @@ public final class ListDeserializer {
                         }
                         exceptionLogged = true;
                     }
-                    input.skipBytes(2 * EncodeConstants.SIZE_OF_SHORT_IN_BYTES);
+                    input.skipBytes(2 * Short.BYTES);
                     continue;
                 }
                 E item = deserializer.deserializeHeader(input);
index 1d58128a368bd9d43e6da455be7c443954d601a0..79d2b63a04f4b9e4cd751e27f8ce225fa0fb20d2 100644 (file)
@@ -50,7 +50,7 @@ public class MatchDeserializer implements OFDeserializer<Match>,
             CodeKeyMaker keyMaker = CodeKeyMakerFactory
                     .createMatchEntriesKeyMaker(EncodeConstants.OF13_VERSION_ID);
             List<MatchEntry> entries = ListDeserializer.deserializeList(EncodeConstants.OF13_VERSION_ID,
-                    length - 2 * EncodeConstants.SIZE_OF_SHORT_IN_BYTES, input, keyMaker, registry);
+                    length - 2 * Short.BYTES, input, keyMaker, registry);
             builder.setMatchEntry(entries);
             int paddingRemainder = length % EncodeConstants.PADDING;
             if (paddingRemainder != 0) {
index 4afa2c364ed36fd40b7e3a81bddf302c7774d1b5..f57b38ba2bf6f0e59a5e85bdb99ddce94c46efe5 100644 (file)
@@ -169,10 +169,10 @@ public class FlowModInputMessageFactoryTest {
         out.readShort();
 
         BufferHelper.checkHeaderV13(out,(byte) 14, 128);
-        cookie = new byte[EncodeConstants.SIZE_OF_LONG_IN_BYTES];
+        cookie = new byte[Long.BYTES];
         out.readBytes(cookie);
         Assert.assertEquals("Wrong cookie", message.getCookie(), Uint64.valueOf("FF01040106000701", 16));
-        cookieMask = new byte[EncodeConstants.SIZE_OF_LONG_IN_BYTES];
+        cookieMask = new byte[Long.BYTES];
         out.readBytes(cookieMask);
         Assert.assertEquals("Wrong cookieMask", message.getCookieMask(), Uint64.valueOf("FF05000009300030", 16));
         Assert.assertEquals("Wrong tableId", message.getTableId().getValue().intValue(), out.readUnsignedByte());
@@ -186,30 +186,30 @@ public class FlowModInputMessageFactoryTest {
         Assert.assertEquals("Wrong flags", message.getFlags(), createFlowModFlagsFromBitmap(out.readUnsignedShort()));
         out.skipBytes(PADDING_IN_FLOW_MOD_MESSAGE);
         Assert.assertEquals("Wrong match type", 1, out.readUnsignedShort());
-        out.skipBytes(EncodeConstants.SIZE_OF_SHORT_IN_BYTES);
+        out.skipBytes(Short.BYTES);
         Assert.assertEquals("Wrong oxm class", 0x8000, out.readUnsignedShort());
         short fieldAndMask = out.readUnsignedByte();
         Assert.assertEquals("Wrong oxm hasMask", 0, fieldAndMask & 1);
         Assert.assertEquals("Wrong oxm field", 1, fieldAndMask >> 1);
-        out.skipBytes(EncodeConstants.SIZE_OF_BYTE_IN_BYTES);
+        out.skipBytes(Byte.BYTES);
         Assert.assertEquals("Wrong oxm value", 42, out.readUnsignedInt());
         Assert.assertEquals("Wrong oxm class", 0x8000, out.readUnsignedShort());
         fieldAndMask = out.readUnsignedByte();
         Assert.assertEquals("Wrong oxm hasMask", 0, fieldAndMask & 1);
         Assert.assertEquals("Wrong oxm field", 9, fieldAndMask >> 1);
-        out.skipBytes(EncodeConstants.SIZE_OF_BYTE_IN_BYTES);
+        out.skipBytes(Byte.BYTES);
         Assert.assertEquals("Wrong oxm value", 4, out.readUnsignedByte());
         out.skipBytes(7);
         Assert.assertEquals("Wrong instruction type", 1, out.readUnsignedShort());
-        out.skipBytes(EncodeConstants.SIZE_OF_SHORT_IN_BYTES);
+        out.skipBytes(Short.BYTES);
         Assert.assertEquals("Wrong instruction value", 43, out.readUnsignedByte());
         out.skipBytes(3);
         Assert.assertEquals("Wrong instruction type", 2, out.readUnsignedShort());
-        out.skipBytes(EncodeConstants.SIZE_OF_SHORT_IN_BYTES);
-        out.skipBytes(EncodeConstants.SIZE_OF_INT_IN_BYTES);
-        byte[] cookieRead = new byte[EncodeConstants.SIZE_OF_LONG_IN_BYTES];
+        out.skipBytes(Short.BYTES);
+        out.skipBytes(Integer.BYTES);
+        byte[] cookieRead = new byte[Long.BYTES];
         out.readBytes(cookieRead);
-        byte[] cookieMaskRead = new byte[EncodeConstants.SIZE_OF_LONG_IN_BYTES];
+        byte[] cookieMaskRead = new byte[Long.BYTES];
         out.readBytes(cookieMaskRead);
         Assert.assertArrayEquals("Wrong metadata", cookie, cookieRead);
         Assert.assertArrayEquals("Wrong metadata mask", cookieMask, cookieMaskRead);
index 3bb61441545551d41a15156bdedccb0ee116903b..4a425ae9afe0f74054831e21b499a5ac970a00cd 100644 (file)
@@ -121,18 +121,18 @@ public class FlowRemovedMessageFactoryTest {
         Assert.assertEquals("Wrong Packet count", message.getPacketCount().longValue(), serializedBuffer.readLong());
         Assert.assertEquals("Wrong Byte count", message.getByteCount().longValue(), serializedBuffer.readLong());
         Assert.assertEquals("Wrong match type", 1, serializedBuffer.readUnsignedShort());
-        serializedBuffer.skipBytes(EncodeConstants.SIZE_OF_SHORT_IN_BYTES);
+        serializedBuffer.skipBytes(Short.BYTES);
         Assert.assertEquals("Wrong oxm class", 0x8000, serializedBuffer.readUnsignedShort());
         short fieldAndMask = serializedBuffer.readUnsignedByte();
         Assert.assertEquals("Wrong oxm hasMask", 0, fieldAndMask & 1);
         Assert.assertEquals("Wrong oxm field", 1, fieldAndMask >> 1);
-        serializedBuffer.skipBytes(EncodeConstants.SIZE_OF_BYTE_IN_BYTES);
+        serializedBuffer.skipBytes(Byte.BYTES);
         Assert.assertEquals("Wrong oxm value", 42, serializedBuffer.readUnsignedInt());
         Assert.assertEquals("Wrong oxm class", 0x8000, serializedBuffer.readUnsignedShort());
         fieldAndMask = serializedBuffer.readUnsignedByte();
         Assert.assertEquals("Wrong oxm hasMask", 0, fieldAndMask & 1);
         Assert.assertEquals("Wrong oxm field", 9, fieldAndMask >> 1);
-        serializedBuffer.skipBytes(EncodeConstants.SIZE_OF_BYTE_IN_BYTES);
+        serializedBuffer.skipBytes(Byte.BYTES);
         Assert.assertEquals("Wrong oxm value", 4, serializedBuffer.readUnsignedByte());
         serializedBuffer.skipBytes(7);
     }
index 7be6047af8eefb182d3b6e79ace98a40b67f4f9b..fac07f4221e9010173e6754f0c3fbab9b3a86d76 100644 (file)
@@ -99,7 +99,7 @@ public class GroupModInputMessageFactoryTest {
     private static List<BucketsList> createBucketsListFromBufer(ByteBuf out) {
         final List<BucketsList> bucketsList = new ArrayList<>();
         BucketsListBuilder bucketsBuilder = new BucketsListBuilder();
-        out.skipBytes(EncodeConstants.SIZE_OF_SHORT_IN_BYTES);
+        out.skipBytes(Short.BYTES);
         bucketsBuilder.setWeight(out.readUnsignedShort());
         bucketsBuilder.setWatchPort(new PortNumber(out.readUnsignedInt()));
         bucketsBuilder.setWatchGroup(out.readUnsignedInt());
index f39db5c95b7558d1757edc0b0a8001b9d397dbd1..d6db32666398dd8970f694b8e07d5559861f139a 100644 (file)
@@ -940,18 +940,18 @@ public class MultipartReplyMessageFactoryTest {
         Assert.assertEquals("Wrong Packet count", flowStats.getPacketCount().longValue(), output.readLong());
         Assert.assertEquals("Wrong Byte count", flowStats.getByteCount().longValue(), output.readLong());
         Assert.assertEquals("Wrong match type", 1, output.readUnsignedShort());
-        output.skipBytes(EncodeConstants.SIZE_OF_SHORT_IN_BYTES);
+        output.skipBytes(Short.BYTES);
         Assert.assertEquals("Wrong oxm class", 0x8000, output.readUnsignedShort());
         short fieldAndMask = output.readUnsignedByte();
         Assert.assertEquals("Wrong oxm hasMask", 0, fieldAndMask & 1);
         Assert.assertEquals("Wrong oxm field", 1, fieldAndMask >> 1);
-        output.skipBytes(EncodeConstants.SIZE_OF_BYTE_IN_BYTES);
+        output.skipBytes(Byte.BYTES);
         Assert.assertEquals("Wrong oxm value", 42, output.readUnsignedInt());
         Assert.assertEquals("Wrong oxm class", 0x8000, output.readUnsignedShort());
         fieldAndMask = output.readUnsignedByte();
         Assert.assertEquals("Wrong oxm hasMask", 0, fieldAndMask & 1);
         Assert.assertEquals("Wrong oxm field", 9, fieldAndMask >> 1);
-        output.skipBytes(EncodeConstants.SIZE_OF_BYTE_IN_BYTES);
+        output.skipBytes(Byte.BYTES);
         Assert.assertEquals("Wrong oxm value", 4, output.readUnsignedByte());
         output.skipBytes(7);
         Assert.assertEquals("Wrong instruction type", 1, output.readUnsignedShort());
index e06c39bfa53ef4252a0515e97beb8bdd9b9e0c42..0961aa76a6bc99529b8efd0e372559f132f65b5c 100644 (file)
@@ -128,10 +128,10 @@ public class MultipartRequestInputFactoryTest {
         builder.setOutPort(output.readUnsignedInt());
         builder.setOutGroup(output.readUnsignedInt());
         output.skipBytes(PADDING_IN_MULTIPART_REQUEST_FLOW_BODY_02);
-        byte[] cookie = new byte[EncodeConstants.SIZE_OF_LONG_IN_BYTES];
+        byte[] cookie = new byte[Long.BYTES];
         output.readBytes(cookie);
         builder.setCookie(new BigInteger(1, cookie));
-        byte[] cookieMask = new byte[EncodeConstants.SIZE_OF_LONG_IN_BYTES];
+        byte[] cookieMask = new byte[Long.BYTES];
         output.readBytes(cookieMask);
         builder.setCookieMask(new BigInteger(1, cookieMask));
         caseBuilder.setMultipartRequestFlow(builder.build());
@@ -190,10 +190,10 @@ public class MultipartRequestInputFactoryTest {
         builder.setOutPort(output.readUnsignedInt());
         builder.setOutGroup(output.readUnsignedInt());
         output.skipBytes(PADDING_IN_MULTIPART_REQUEST_AGGREGATE_BODY_02);
-        byte[] cookie = new byte[EncodeConstants.SIZE_OF_LONG_IN_BYTES];
+        byte[] cookie = new byte[Long.BYTES];
         output.readBytes(cookie);
         builder.setCookie(new BigInteger(1, cookie));
-        byte[] cookieMask = new byte[EncodeConstants.SIZE_OF_LONG_IN_BYTES];
+        byte[] cookieMask = new byte[Long.BYTES];
         output.readBytes(cookieMask);
         builder.setCookieMask(new BigInteger(1, cookieMask));
         caseBuilder.setMultipartRequestAggregate(builder.build());
index 9fd128262e48be0b735e15cb5ac5f1d8891e59db..f1ac742bd62cd2d0ddd42ae7ee254c642458f381 100644 (file)
@@ -104,22 +104,22 @@ public class PacketInMessageFactoryTest {
         Assert.assertEquals("Wrong reason", message.getReason().getIntValue(), serializedBuffer.readUnsignedByte());
         Assert.assertEquals("Wrong tableId", message.getTableId().getValue().intValue(),
                 serializedBuffer.readUnsignedByte());
-        cookie = new byte[EncodeConstants.SIZE_OF_LONG_IN_BYTES];
+        cookie = new byte[Long.BYTES];
         serializedBuffer.readBytes(cookie);
         Assert.assertEquals("Wrong cookie", message.getCookie(), Uint64.valueOf(new BigInteger(1, cookie)));
         Assert.assertEquals("Wrong match type", 1, serializedBuffer.readUnsignedShort());
-        serializedBuffer.skipBytes(EncodeConstants.SIZE_OF_SHORT_IN_BYTES);
+        serializedBuffer.skipBytes(Short.BYTES);
         Assert.assertEquals("Wrong oxm class", 0x8000, serializedBuffer.readUnsignedShort());
         short fieldAndMask = serializedBuffer.readUnsignedByte();
         Assert.assertEquals("Wrong oxm hasMask", 0, fieldAndMask & 1);
         Assert.assertEquals("Wrong oxm field", 1, fieldAndMask >> 1);
-        serializedBuffer.skipBytes(EncodeConstants.SIZE_OF_BYTE_IN_BYTES);
+        serializedBuffer.skipBytes(Byte.BYTES);
         Assert.assertEquals("Wrong oxm value", 42, serializedBuffer.readUnsignedInt());
         Assert.assertEquals("Wrong oxm class", 0x8000, serializedBuffer.readUnsignedShort());
         fieldAndMask = serializedBuffer.readUnsignedByte();
         Assert.assertEquals("Wrong oxm hasMask", 0, fieldAndMask & 1);
         Assert.assertEquals("Wrong oxm field", 9, fieldAndMask >> 1);
-        serializedBuffer.skipBytes(EncodeConstants.SIZE_OF_BYTE_IN_BYTES);
+        serializedBuffer.skipBytes(Byte.BYTES);
         Assert.assertEquals("Wrong oxm value", 4, serializedBuffer.readUnsignedByte());
         serializedBuffer.skipBytes(7);
         serializedBuffer.skipBytes(PADDING);
index e0e3def16b35b68721ce18cb8fc1788aaab71056..baf0e8d8c08f4dd86cd5588e70c496c510ed719e 100644 (file)
@@ -90,7 +90,7 @@ public class PacketOutInputMessageFactoryTest {
         Assert.assertEquals("Wrong action type", 17, out.readUnsignedShort());
         Assert.assertEquals("Wrong action length", 8, out.readUnsignedShort());
         Assert.assertEquals("Wrong ethertype", 25, out.readUnsignedShort());
-        out.skipBytes(EncodeConstants.SIZE_OF_SHORT_IN_BYTES);
+        out.skipBytes(Short.BYTES);
         Assert.assertEquals("Wrong action type", 18, out.readUnsignedShort());
         Assert.assertEquals("Wrong action length", 8, out.readUnsignedShort());
         out.skipBytes(PADDING_IN_ACTION_HEADER);
index 563bf3e84aa34d75e5580d2245f08be5a679c443..9511016ebaf502198e6f004122b9801b0a8a3460 100644 (file)
@@ -56,7 +56,7 @@ public class RoleReplyMessageFactoryTest {
         Assert.assertEquals("Wrong role", message.getRole().getIntValue(),
                 ControllerRole.forValue((int) serializedBuffer.readUnsignedInt()).getIntValue());
         serializedBuffer.skipBytes(PADDING);
-        byte[] genId = new byte[EncodeConstants.SIZE_OF_LONG_IN_BYTES];
+        byte[] genId = new byte[Long.BYTES];
         serializedBuffer.readBytes(genId);
         Assert.assertEquals("Wrong generation ID", message.getGenerationId(), Uint64.valueOf(new BigInteger(1, genId)));
     }
index 057e83c8c5cf09307c292cb87b6fdc0773824d8c..af431b02f1d98fedeff84de5a7a7113c021f4599 100644 (file)
@@ -68,7 +68,7 @@ public class RoleRequestInputMessageFactoryTest {
         Assert.assertEquals("Wrong role", message.getRole().getIntValue(),
                 ControllerRole.forValue((int) out.readUnsignedInt()).getIntValue());
         out.skipBytes(PADDING_IN_ROLE_REQUEST_MESSAGE);
-        byte[] genId = new byte[EncodeConstants.SIZE_OF_LONG_IN_BYTES];
+        byte[] genId = new byte[Long.BYTES];
         out.readBytes(genId);
         Assert.assertEquals("Wrong generation ID", message.getGenerationId(), Uint64.valueOf(new BigInteger(1, genId)));
     }
index 8fd90bfbbaa9318951edb96c3d409cb264b60c8b..6a0bd2e83caa33f92ae7fc454a5f9e6037d18eaf 100644 (file)
@@ -258,11 +258,11 @@ public class MultipartRequestTableFeaturesTest {
         out.skipBytes(5);
         Assert.assertEquals("Wrong name", "AAAABBBBCCCCDDDDEEEEFFFFGGGG",
                 ByteBufUtils.decodeNullTerminatedString(out, 32));
-        byte[] metadataMatch = new byte[EncodeConstants.SIZE_OF_LONG_IN_BYTES];
+        byte[] metadataMatch = new byte[Long.BYTES];
         out.readBytes(metadataMatch);
         Assert.assertArrayEquals("Wrong metadata-match",
                 new byte[] {0x00, 0x01, 0x02, 0x03, 0x01, 0x04, 0x08, 0x01}, metadataMatch);
-        byte[] metadataWrite = new byte[EncodeConstants.SIZE_OF_LONG_IN_BYTES];
+        byte[] metadataWrite = new byte[Long.BYTES];
         out.readBytes(metadataWrite);
         Assert.assertArrayEquals("Wrong metadata-write",
                 new byte[] {0x00, 0x07, 0x01, 0x05, 0x01, 0x00, 0x03, 0x01}, metadataWrite);
@@ -300,11 +300,11 @@ public class MultipartRequestTableFeaturesTest {
         out.skipBytes(5);
         Assert.assertEquals("Wrong name", "AAAABBBBCCCCDDDDEEEEFFFFGGGG",
                 ByteBufUtils.decodeNullTerminatedString(out, 32));
-        metadataMatch = new byte[EncodeConstants.SIZE_OF_LONG_IN_BYTES];
+        metadataMatch = new byte[Long.BYTES];
         out.readBytes(metadataMatch);
         Assert.assertArrayEquals("Wrong metadata-match",
                 new byte[] {0x00, 0x01, 0x02, 0x03, 0x01, 0x04, 0x08, 0x01}, metadataMatch);
-        metadataWrite = new byte[EncodeConstants.SIZE_OF_LONG_IN_BYTES];
+        metadataWrite = new byte[Long.BYTES];
         out.readBytes(metadataWrite);
         Assert.assertArrayEquals("Wrong metadata-write",
                 new byte[] {0x00, 0x07, 0x01, 0x05, 0x01, 0x00, 0x03, 0x01}, metadataWrite);
@@ -411,11 +411,11 @@ public class MultipartRequestTableFeaturesTest {
         out.skipBytes(5);
         Assert.assertEquals("Wrong name", "AAAABBBBCCCCDDDDEEEEFFFFGGGG",
                 ByteBufUtils.decodeNullTerminatedString(out, 32));
-        byte[] metadataMatch = new byte[EncodeConstants.SIZE_OF_LONG_IN_BYTES];
+        byte[] metadataMatch = new byte[Long.BYTES];
         out.readBytes(metadataMatch);
         Assert.assertArrayEquals("Wrong metadata-match",
                 new byte[] {0x00, 0x01, 0x02, 0x03, 0x01, 0x04, 0x08, 0x01}, metadataMatch);
-        byte[] metadataWrite = new byte[EncodeConstants.SIZE_OF_LONG_IN_BYTES];
+        byte[] metadataWrite = new byte[Long.BYTES];
         out.readBytes(metadataWrite);
         Assert.assertArrayEquals("Wrong metadata-write",
                 new byte[] {0x00, 0x07, 0x01, 0x05, 0x01, 0x00, 0x03, 0x01}, metadataWrite);
index 7c9a60ab55a8790407d3d58b83d21f4e6ba0fede..f51a3817898f6a60d7e55e15b7fb1f8e9ca68c7f 100644 (file)
@@ -5,7 +5,6 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowjava.protocol.impl.serialization.match;
 
 import static org.junit.Assert.assertEquals;
@@ -14,7 +13,6 @@ import static org.junit.Assert.assertTrue;
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.PooledByteBufAllocator;
 import org.junit.Test;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.ArpOp;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.OpenflowBasicClass;
@@ -81,7 +79,7 @@ public class OxmArpOpSerializerTest {
      */
     @Test
     public void testGetValueLength() {
-        assertEquals("Wrong value length", EncodeConstants.SIZE_OF_SHORT_IN_BYTES, serializer.getValueLength());
+        assertEquals("Wrong value length", Short.BYTES, serializer.getValueLength());
     }
 
     private static MatchEntryBuilder prepareArpOpMatchEntry(int value) {
@@ -107,6 +105,6 @@ public class OxmArpOpSerializerTest {
         short fieldAndMask = buffer.readUnsignedByte();
         assertEquals("Wrong oxm-field", OxmMatchConstants.ARP_OP, fieldAndMask >>> 1);
         assertEquals("Wrong hasMask", hasMask, (fieldAndMask & 1) != 0);
-        assertEquals("Wrong length", EncodeConstants.SIZE_OF_SHORT_IN_BYTES, buffer.readUnsignedByte());
+        assertEquals("Wrong length", Short.BYTES, buffer.readUnsignedByte());
     }
 }
index c5f674083a68d4e36c8b43e935278d0c394a05a5..406b3e9fd68ea0adc991d64661ae1335936c79c1 100644 (file)
@@ -5,7 +5,6 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowjava.protocol.impl.serialization.match;
 
 import static org.junit.Assert.assertEquals;
@@ -15,7 +14,6 @@ import io.netty.buffer.ByteBuf;
 import io.netty.buffer.PooledByteBufAllocator;
 import org.junit.Assert;
 import org.junit.Test;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Address;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.ArpSpa;
@@ -120,7 +118,7 @@ public class OxmArpSpaSerializerTest {
      */
     @Test
     public void testGetValueLength() {
-        assertEquals("Wrong value length", EncodeConstants.SIZE_OF_INT_IN_BYTES, serializer.getValueLength());
+        assertEquals("Wrong value length", Integer.BYTES, serializer.getValueLength());
     }
 
     private static MatchEntryBuilder prepareMatchEntry(boolean hasMask, String value) {
@@ -150,9 +148,9 @@ public class OxmArpSpaSerializerTest {
         assertEquals("Wrong oxm-field", OxmMatchConstants.ARP_SPA, fieldAndMask >>> 1);
         assertEquals("Wrong hasMask", hasMask, (fieldAndMask & 1) != 0);
         if (hasMask) {
-            assertEquals("Wrong length", EncodeConstants.SIZE_OF_LONG_IN_BYTES, buffer.readUnsignedByte());
+            assertEquals("Wrong length", Long.BYTES, buffer.readUnsignedByte());
         } else {
-            assertEquals("Wrong length", EncodeConstants.SIZE_OF_INT_IN_BYTES, buffer.readUnsignedByte());
+            assertEquals("Wrong length", Integer.BYTES, buffer.readUnsignedByte());
         }
     }
 }
index de71662063f3d249fdb5b511fc66f468263049f5..c3d0ee47cacd563608808dece0d1445612a777dc 100644 (file)
@@ -5,7 +5,6 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowjava.protocol.impl.serialization.match;
 
 import static org.junit.Assert.assertEquals;
@@ -15,7 +14,6 @@ import io.netty.buffer.ByteBuf;
 import io.netty.buffer.PooledByteBufAllocator;
 import org.junit.Assert;
 import org.junit.Test;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Address;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.ArpTpa;
@@ -120,7 +118,7 @@ public class OxmArpTpaSerializerTest {
      */
     @Test
     public void testGetValueLength() {
-        assertEquals("Wrong value length", EncodeConstants.SIZE_OF_INT_IN_BYTES, serializer.getValueLength());
+        assertEquals("Wrong value length", Integer.BYTES, serializer.getValueLength());
     }
 
     private static MatchEntryBuilder prepareMatchEntry(boolean hasMask, String value) {
@@ -150,9 +148,9 @@ public class OxmArpTpaSerializerTest {
         assertEquals("Wrong oxm-field", OxmMatchConstants.ARP_TPA, fieldAndMask >>> 1);
         assertEquals("Wrong hasMask", hasMask, (fieldAndMask & 1) != 0);
         if (hasMask) {
-            assertEquals("Wrong length", EncodeConstants.SIZE_OF_LONG_IN_BYTES, buffer.readUnsignedByte());
+            assertEquals("Wrong length", Long.BYTES, buffer.readUnsignedByte());
         } else {
-            assertEquals("Wrong length", EncodeConstants.SIZE_OF_INT_IN_BYTES, buffer.readUnsignedByte());
+            assertEquals("Wrong length", Integer.BYTES, buffer.readUnsignedByte());
         }
     }
 }
index eec39173082cdaef1eaed52f2512f73a1d120dcb..3c2bf711da9f13cb2211a1648611aaa08ad95f70 100644 (file)
@@ -5,7 +5,6 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowjava.protocol.impl.serialization.match;
 
 import static org.junit.Assert.assertEquals;
@@ -14,7 +13,6 @@ import static org.junit.Assert.assertTrue;
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.PooledByteBufAllocator;
 import org.junit.Test;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.EtherType;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.EthType;
@@ -82,7 +80,7 @@ public class OxmEthTypeSerializerTest {
      */
     @Test
     public void testGetValueLength() {
-        assertEquals("Wrong value length", EncodeConstants.SIZE_OF_SHORT_IN_BYTES, serializer.getValueLength());
+        assertEquals("Wrong value length", Short.BYTES, serializer.getValueLength());
     }
 
     private static MatchEntryBuilder prepareEthTypeMatchEntry(int type) {
@@ -108,6 +106,6 @@ public class OxmEthTypeSerializerTest {
         short fieldAndMask = buffer.readUnsignedByte();
         assertEquals("Wrong oxm-field", OxmMatchConstants.ETH_TYPE, fieldAndMask >>> 1);
         assertEquals("Wrong hasMask", hasMask, (fieldAndMask & 1) != 0);
-        assertEquals("Wrong length", EncodeConstants.SIZE_OF_SHORT_IN_BYTES, buffer.readUnsignedByte());
+        assertEquals("Wrong length", Short.BYTES, buffer.readUnsignedByte());
     }
 }
index 4aaea0543a4498ce0ab2134f54de0f3138d79a15..27918975d083d041ab88aa86e7a32ff2e96ee3d4 100644 (file)
@@ -5,7 +5,6 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowjava.protocol.impl.serialization.match;
 
 import static org.junit.Assert.assertEquals;
@@ -14,7 +13,6 @@ import static org.junit.Assert.assertTrue;
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.PooledByteBufAllocator;
 import org.junit.Test;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.Icmpv4Code;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.OpenflowBasicClass;
@@ -81,7 +79,7 @@ public class OxmIcmpv4CodeSerializerTest {
      */
     @Test
     public void testGetValueLength() {
-        assertEquals("Wrong value length", EncodeConstants.SIZE_OF_BYTE_IN_BYTES, serializer.getValueLength());
+        assertEquals("Wrong value length", Byte.BYTES, serializer.getValueLength());
     }
 
     private static MatchEntryBuilder prepareIcmpv4CodeMatchEntry(short value) {
@@ -107,6 +105,6 @@ public class OxmIcmpv4CodeSerializerTest {
         short fieldAndMask = buffer.readUnsignedByte();
         assertEquals("Wrong oxm-field", OxmMatchConstants.ICMPV4_CODE, fieldAndMask >>> 1);
         assertEquals("Wrong hasMask", hasMask, (fieldAndMask & 1) != 0);
-        assertEquals("Wrong length", EncodeConstants.SIZE_OF_BYTE_IN_BYTES, buffer.readUnsignedByte());
+        assertEquals("Wrong length", Byte.BYTES, buffer.readUnsignedByte());
     }
 }
index a35d47d2d1136c0267ec575461a0b0e1b0196fde..769613dffec0dc02211a8166fe54079179e4f609 100644 (file)
@@ -5,7 +5,6 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowjava.protocol.impl.serialization.match;
 
 import static org.junit.Assert.assertEquals;
@@ -14,7 +13,6 @@ import static org.junit.Assert.assertTrue;
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.PooledByteBufAllocator;
 import org.junit.Test;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.Icmpv4Type;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.OpenflowBasicClass;
@@ -81,7 +79,7 @@ public class OxmIcmpv4TypeSerializerTest {
      */
     @Test
     public void testGetValueLength() {
-        assertEquals("Wrong value length", EncodeConstants.SIZE_OF_BYTE_IN_BYTES, serializer.getValueLength());
+        assertEquals("Wrong value length", Byte.BYTES, serializer.getValueLength());
     }
 
     private static MatchEntryBuilder prepareIcmpv4TypeMatchEntry(short value) {
@@ -107,6 +105,6 @@ public class OxmIcmpv4TypeSerializerTest {
         short fieldAndMask = buffer.readUnsignedByte();
         assertEquals("Wrong oxm-field", OxmMatchConstants.ICMPV4_TYPE, fieldAndMask >>> 1);
         assertEquals("Wrong hasMask", hasMask, (fieldAndMask & 1) != 0);
-        assertEquals("Wrong length", EncodeConstants.SIZE_OF_BYTE_IN_BYTES, buffer.readUnsignedByte());
+        assertEquals("Wrong length", Byte.BYTES, buffer.readUnsignedByte());
     }
 }
index 8019f5c7cf6ba78b64fa373dd61d2d5dad99174a..17f7fb2f4ef8ccc035419ae39832eeaeff078164 100644 (file)
@@ -5,7 +5,6 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowjava.protocol.impl.serialization.match;
 
 import static org.junit.Assert.assertEquals;
@@ -14,7 +13,6 @@ import static org.junit.Assert.assertTrue;
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.PooledByteBufAllocator;
 import org.junit.Test;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.Icmpv6Code;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.OpenflowBasicClass;
@@ -81,7 +79,7 @@ public class OxmIcmpv6CodeSerializerTest {
      */
     @Test
     public void testGetValueLength() {
-        assertEquals("Wrong value length", EncodeConstants.SIZE_OF_BYTE_IN_BYTES, serializer.getValueLength());
+        assertEquals("Wrong value length", Byte.BYTES, serializer.getValueLength());
     }
 
     private static MatchEntryBuilder prepareIcmpv6CodeMatchEntry(short value) {
@@ -107,6 +105,6 @@ public class OxmIcmpv6CodeSerializerTest {
         short fieldAndMask = buffer.readUnsignedByte();
         assertEquals("Wrong oxm-field", OxmMatchConstants.ICMPV6_CODE, fieldAndMask >>> 1);
         assertEquals("Wrong hasMask", hasMask, (fieldAndMask & 1) != 0);
-        assertEquals("Wrong length", EncodeConstants.SIZE_OF_BYTE_IN_BYTES, buffer.readUnsignedByte());
+        assertEquals("Wrong length", Byte.BYTES, buffer.readUnsignedByte());
     }
 }
index 82bdbfd51ea835e832f2af40a73efcb79cf34363..0d25c9e8d43cac2a5b05d6627d823ef7b026cd04 100644 (file)
@@ -5,7 +5,6 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowjava.protocol.impl.serialization.match;
 
 import static org.junit.Assert.assertEquals;
@@ -14,7 +13,6 @@ import static org.junit.Assert.assertTrue;
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.PooledByteBufAllocator;
 import org.junit.Test;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.Icmpv6Type;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.OpenflowBasicClass;
@@ -81,7 +79,7 @@ public class OxmIcmpv6TypeSerializerTest {
      */
     @Test
     public void testGetValueLength() {
-        assertEquals("Wrong value length", EncodeConstants.SIZE_OF_BYTE_IN_BYTES, serializer.getValueLength());
+        assertEquals("Wrong value length", Byte.BYTES, serializer.getValueLength());
     }
 
     private static MatchEntryBuilder prepareIcmpv6TypeMatchEntry(short value) {
@@ -107,6 +105,6 @@ public class OxmIcmpv6TypeSerializerTest {
         short fieldAndMask = buffer.readUnsignedByte();
         assertEquals("Wrong oxm-field", OxmMatchConstants.ICMPV6_TYPE, fieldAndMask >>> 1);
         assertEquals("Wrong hasMask", hasMask, (fieldAndMask & 1) != 0);
-        assertEquals("Wrong length", EncodeConstants.SIZE_OF_BYTE_IN_BYTES, buffer.readUnsignedByte());
+        assertEquals("Wrong length", Byte.BYTES, buffer.readUnsignedByte());
     }
 }
index 9d0d96e7acdb8038ebcc29efb7b576c6b79d782a..c82b3049901088842ecc724b559127e4e307c686 100644 (file)
@@ -5,7 +5,6 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowjava.protocol.impl.serialization.match;
 
 import static org.junit.Assert.assertEquals;
@@ -14,7 +13,6 @@ import static org.junit.Assert.assertTrue;
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.PooledByteBufAllocator;
 import org.junit.Test;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Dscp;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.IpDscp;
@@ -82,7 +80,7 @@ public class OxmIpDscpSerializerTest {
      */
     @Test
     public void testGetValueLength() {
-        assertEquals("Wrong value length", EncodeConstants.SIZE_OF_BYTE_IN_BYTES, serializer.getValueLength());
+        assertEquals("Wrong value length", Byte.BYTES, serializer.getValueLength());
     }
 
     private static MatchEntryBuilder prepareIpDscpMatchEntry(short value) {
@@ -108,6 +106,6 @@ public class OxmIpDscpSerializerTest {
         short fieldAndMask = buffer.readUnsignedByte();
         assertEquals("Wrong oxm-field", OxmMatchConstants.IP_DSCP, fieldAndMask >>> 1);
         assertEquals("Wrong hasMask", hasMask, (fieldAndMask & 1) != 0);
-        assertEquals("Wrong length", EncodeConstants.SIZE_OF_BYTE_IN_BYTES, buffer.readUnsignedByte());
+        assertEquals("Wrong length", Byte.BYTES, buffer.readUnsignedByte());
     }
 }
index 1e053bd854794e2a4f59c1c25cf5bba228cadcd4..c503a321ad3edcc34eff6ab848ae80cd3da8f05e 100644 (file)
@@ -5,7 +5,6 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowjava.protocol.impl.serialization.match;
 
 import static org.junit.Assert.assertEquals;
@@ -14,7 +13,6 @@ import static org.junit.Assert.assertTrue;
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.PooledByteBufAllocator;
 import org.junit.Test;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.IpProto;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.OpenflowBasicClass;
@@ -81,7 +79,7 @@ public class OxmIpProtoSerializerTest {
      */
     @Test
     public void testGetValueLength() {
-        assertEquals("Wrong value length", EncodeConstants.SIZE_OF_BYTE_IN_BYTES, serializer.getValueLength());
+        assertEquals("Wrong value length", Byte.BYTES, serializer.getValueLength());
     }
 
     private static MatchEntryBuilder prepareMatchEntry(short value) {
@@ -107,6 +105,6 @@ public class OxmIpProtoSerializerTest {
         short fieldAndMask = buffer.readUnsignedByte();
         assertEquals("Wrong oxm-field", OxmMatchConstants.IP_PROTO, fieldAndMask >>> 1);
         assertEquals("Wrong hasMask", hasMask, (fieldAndMask & 1) != 0);
-        assertEquals("Wrong length", EncodeConstants.SIZE_OF_BYTE_IN_BYTES, buffer.readUnsignedByte());
+        assertEquals("Wrong length", Byte.BYTES, buffer.readUnsignedByte());
     }
 }
index 4b20c77967ad1e4c168d306484e5f45faec91f4f..68f560680c9f9979890e5c628f85d487aed94a44 100644 (file)
@@ -5,7 +5,6 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowjava.protocol.impl.serialization.match;
 
 import static org.junit.Assert.assertEquals;
@@ -15,7 +14,6 @@ import io.netty.buffer.ByteBuf;
 import io.netty.buffer.PooledByteBufAllocator;
 import org.junit.Assert;
 import org.junit.Test;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Address;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.Ipv4Dst;
@@ -120,7 +118,7 @@ public class OxmIpv4DstSerializerTest {
      */
     @Test
     public void testGetValueLength() {
-        assertEquals("Wrong value length", EncodeConstants.SIZE_OF_INT_IN_BYTES, serializer.getValueLength());
+        assertEquals("Wrong value length", Integer.BYTES, serializer.getValueLength());
     }
 
     private static MatchEntryBuilder prepareMatchEntry(boolean hasMask, String value) {
@@ -150,9 +148,9 @@ public class OxmIpv4DstSerializerTest {
         assertEquals("Wrong oxm-field", OxmMatchConstants.IPV4_DST, fieldAndMask >>> 1);
         assertEquals("Wrong hasMask", hasMask, (fieldAndMask & 1) != 0);
         if (hasMask) {
-            assertEquals("Wrong length", EncodeConstants.SIZE_OF_LONG_IN_BYTES, buffer.readUnsignedByte());
+            assertEquals("Wrong length", Long.BYTES, buffer.readUnsignedByte());
         } else {
-            assertEquals("Wrong length", EncodeConstants.SIZE_OF_INT_IN_BYTES, buffer.readUnsignedByte());
+            assertEquals("Wrong length", Integer.BYTES, buffer.readUnsignedByte());
         }
     }
 }
index a6789c06dd6606fec7c7709cf7a56bf616a5a621..95252a1dbc8490c0cfcf12ee1a9bcb7e0fd88235 100644 (file)
@@ -5,7 +5,6 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowjava.protocol.impl.serialization.match;
 
 import static org.junit.Assert.assertEquals;
@@ -15,7 +14,6 @@ import io.netty.buffer.ByteBuf;
 import io.netty.buffer.PooledByteBufAllocator;
 import org.junit.Assert;
 import org.junit.Test;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Address;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.Ipv4Src;
@@ -120,7 +118,7 @@ public class OxmIpv4SrcSerializerTest {
      */
     @Test
     public void testGetValueLength() {
-        assertEquals("Wrong value length", EncodeConstants.SIZE_OF_INT_IN_BYTES, serializer.getValueLength());
+        assertEquals("Wrong value length", Integer.BYTES, serializer.getValueLength());
     }
 
     private static MatchEntryBuilder prepareMatchEntry(boolean hasMask, String value) {
@@ -150,9 +148,9 @@ public class OxmIpv4SrcSerializerTest {
         assertEquals("Wrong oxm-field", OxmMatchConstants.IPV4_SRC, fieldAndMask >>> 1);
         assertEquals("Wrong hasMask", hasMask, (fieldAndMask & 1) != 0);
         if (hasMask) {
-            assertEquals("Wrong length", EncodeConstants.SIZE_OF_LONG_IN_BYTES, buffer.readUnsignedByte());
+            assertEquals("Wrong length", Long.BYTES, buffer.readUnsignedByte());
         } else {
-            assertEquals("Wrong length", EncodeConstants.SIZE_OF_INT_IN_BYTES, buffer.readUnsignedByte());
+            assertEquals("Wrong length", Integer.BYTES, buffer.readUnsignedByte());
         }
     }
 }
index 57dfc2e36bdb4063df482c15eec885a0a0cfb8ca..8a5809813b18be5db975ab3d66a4e9fc9b1d15ca 100644 (file)
@@ -5,7 +5,6 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowjava.protocol.impl.serialization.match;
 
 import static org.junit.Assert.assertEquals;
@@ -15,7 +14,6 @@ import io.netty.buffer.ByteBuf;
 import io.netty.buffer.PooledByteBufAllocator;
 import org.junit.Assert;
 import org.junit.Test;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.Ipv6ExthdrFlags;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.Ipv6Exthdr;
@@ -117,7 +115,7 @@ public class OxmIpv6ExtHdrSerializerTest {
      */
     @Test
     public void testGetValueLength() {
-        assertEquals("Wrong value length", EncodeConstants.SIZE_OF_SHORT_IN_BYTES, serializer.getValueLength());
+        assertEquals("Wrong value length", Short.BYTES, serializer.getValueLength());
     }
 
     private static MatchEntryBuilder prepareIpv6ExtHdrMatchEntry(boolean hasMask, Ipv6ExthdrFlags flags) {
@@ -147,9 +145,9 @@ public class OxmIpv6ExtHdrSerializerTest {
         assertEquals("Wrong oxm-field", OxmMatchConstants.IPV6_EXTHDR, fieldAndMask >>> 1);
         assertEquals("Wrong hasMask", hasMask, (fieldAndMask & 1) != 0);
         if (hasMask) {
-            assertEquals("Wrong length", EncodeConstants.SIZE_OF_INT_IN_BYTES, buffer.readUnsignedByte());
+            assertEquals("Wrong length", Integer.BYTES, buffer.readUnsignedByte());
         } else {
-            assertEquals("Wrong length", EncodeConstants.SIZE_OF_SHORT_IN_BYTES, buffer.readUnsignedByte());
+            assertEquals("Wrong length", Short.BYTES, buffer.readUnsignedByte());
         }
     }
 }
index 93c6258f6ec458c78ce28e7c4d5c1e3414cd9c98..67f64836e5e2e05b3413c353ca8d50d245323154 100644 (file)
@@ -5,7 +5,6 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowjava.protocol.impl.serialization.match;
 
 import static org.junit.Assert.assertEquals;
@@ -15,7 +14,6 @@ import io.netty.buffer.ByteBuf;
 import io.netty.buffer.PooledByteBufAllocator;
 import org.junit.Assert;
 import org.junit.Test;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.Metadata;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.OpenflowBasicClass;
@@ -119,7 +117,7 @@ public class OxmMetadataSerializerTest {
      */
     @Test
     public void testGetValueLength() {
-        assertEquals("Wrong value length", EncodeConstants.SIZE_OF_LONG_IN_BYTES, serializer.getValueLength());
+        assertEquals("Wrong value length", Long.BYTES, serializer.getValueLength());
     }
 
     private static MatchEntryBuilder prepareMatchEntry(boolean hasMask, byte[] value) {
@@ -149,9 +147,9 @@ public class OxmMetadataSerializerTest {
         assertEquals("Wrong oxm-field", OxmMatchConstants.METADATA, fieldAndMask >>> 1);
         assertEquals("Wrong hasMask", hasMask, (fieldAndMask & 1) != 0);
         if (hasMask) {
-            assertEquals("Wrong length", 2 * EncodeConstants.SIZE_OF_LONG_IN_BYTES, buffer.readUnsignedByte());
+            assertEquals("Wrong length", 2 * Long.BYTES, buffer.readUnsignedByte());
         } else {
-            assertEquals("Wrong length", EncodeConstants.SIZE_OF_LONG_IN_BYTES, buffer.readUnsignedByte());
+            assertEquals("Wrong length", Long.BYTES, buffer.readUnsignedByte());
         }
     }
 }
index f26a4fb10f7a9dbb9b6d3380f5e2ebdd8dd75ff5..2a4a7198b69a0f379b6744494aadca6265ddd4c1 100644 (file)
@@ -5,7 +5,6 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowjava.protocol.impl.serialization.match;
 
 import static org.junit.Assert.assertEquals;
@@ -14,7 +13,6 @@ import static org.junit.Assert.assertTrue;
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.PooledByteBufAllocator;
 import org.junit.Test;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.MplsBos;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.OpenflowBasicClass;
@@ -81,7 +79,7 @@ public class OxmMplsBosSerializerTest {
      */
     @Test
     public void testGetValueLength() {
-        assertEquals("Wrong value length", EncodeConstants.SIZE_OF_BYTE_IN_BYTES, serializer.getValueLength());
+        assertEquals("Wrong value length", Byte.BYTES, serializer.getValueLength());
     }
 
     private static MatchEntryBuilder prepareMplsBosMatchEntry(boolean bos) {
@@ -107,6 +105,6 @@ public class OxmMplsBosSerializerTest {
         short fieldAndMask = buffer.readUnsignedByte();
         assertEquals("Wrong oxm-field", OxmMatchConstants.MPLS_BOS, fieldAndMask >>> 1);
         assertEquals("Wrong hasMask", hasMask, (fieldAndMask & 1) != 0);
-        assertEquals("Wrong length", EncodeConstants.SIZE_OF_BYTE_IN_BYTES, buffer.readUnsignedByte());
+        assertEquals("Wrong length", Byte.BYTES, buffer.readUnsignedByte());
     }
 }
index b2b927d5eb9c8620aa65d0b0e9a7d2832cd2006c..a9c78196bac7af057c4b267b55788203d4a4b475 100644 (file)
@@ -5,7 +5,6 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowjava.protocol.impl.serialization.match;
 
 import static org.junit.Assert.assertEquals;
@@ -14,7 +13,6 @@ import static org.junit.Assert.assertTrue;
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.PooledByteBufAllocator;
 import org.junit.Test;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.MplsLabel;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.OpenflowBasicClass;
@@ -81,7 +79,7 @@ public class OxmMplsLabelSerializerTest {
      */
     @Test
     public void testGetValueLength() {
-        assertEquals("Wrong value length", EncodeConstants.SIZE_OF_INT_IN_BYTES, serializer.getValueLength());
+        assertEquals("Wrong value length", Integer.BYTES, serializer.getValueLength());
     }
 
     private static MatchEntryBuilder prepareMplsLabelMatchEntry(long label) {
@@ -107,6 +105,6 @@ public class OxmMplsLabelSerializerTest {
         short fieldAndMask = buffer.readUnsignedByte();
         assertEquals("Wrong oxm-field", OxmMatchConstants.MPLS_LABEL, fieldAndMask >>> 1);
         assertEquals("Wrong hasMask", hasMask, (fieldAndMask & 1) != 0);
-        assertEquals("Wrong length", EncodeConstants.SIZE_OF_INT_IN_BYTES, buffer.readUnsignedByte());
+        assertEquals("Wrong length", Integer.BYTES, buffer.readUnsignedByte());
     }
 }
index 093afad098a1e70bf669b0d4293bd8a812125573..2cf22df4fb133c3410fdd9ae33b2b08df8a9710d 100644 (file)
@@ -5,7 +5,6 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowjava.protocol.impl.serialization.match;
 
 import static org.junit.Assert.assertEquals;
@@ -14,7 +13,6 @@ import static org.junit.Assert.assertTrue;
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.PooledByteBufAllocator;
 import org.junit.Test;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.MplsTc;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.OpenflowBasicClass;
@@ -81,7 +79,7 @@ public class OxmMplsTcSerializerTest {
      */
     @Test
     public void testGetValueLength() {
-        assertEquals("Wrong value length", EncodeConstants.SIZE_OF_BYTE_IN_BYTES, serializer.getValueLength());
+        assertEquals("Wrong value length", Byte.BYTES, serializer.getValueLength());
     }
 
     private static MatchEntryBuilder prepareMplsTcMatchEntry(short value) {
@@ -107,6 +105,6 @@ public class OxmMplsTcSerializerTest {
         short fieldAndMask = buffer.readUnsignedByte();
         assertEquals("Wrong oxm-field", OxmMatchConstants.MPLS_TC, fieldAndMask >>> 1);
         assertEquals("Wrong hasMask", hasMask, (fieldAndMask & 1) != 0);
-        assertEquals("Wrong length", EncodeConstants.SIZE_OF_BYTE_IN_BYTES, buffer.readUnsignedByte());
+        assertEquals("Wrong length", Byte.BYTES, buffer.readUnsignedByte());
     }
 }
index e203b0baf1b713276a6ef7ddeff97cd36abadd92..1c9faac4fdb70975f298df632f21b049a7c5f59b 100644 (file)
@@ -13,7 +13,6 @@ import io.netty.buffer.ByteBuf;
 import io.netty.buffer.PooledByteBufAllocator;
 import org.junit.Before;
 import org.junit.Test;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.OpenflowBasicClass;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.PacketType;
@@ -24,7 +23,6 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.matc
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.packet.type._case.PacketTypeBuilder;
 
 public class OxmPacketTypeSerializerTest {
-
     private ByteBuf buffer;
     private OxmPacketTypeSerializer serializer;
 
@@ -45,7 +43,7 @@ public class OxmPacketTypeSerializerTest {
         short fieldMask = buffer.readUnsignedByte();
         assertEquals(OxmMatchConstants.PACKET_TYPE, fieldMask >> 1);
         assertEquals(0, fieldMask & 1);
-        assertEquals(EncodeConstants.SIZE_OF_INT_IN_BYTES, buffer.readUnsignedByte());
+        assertEquals(Integer.BYTES, buffer.readUnsignedByte());
         assertEquals(packetType, buffer.readUnsignedInt());
     }
 
@@ -60,4 +58,4 @@ public class OxmPacketTypeSerializerTest {
                 .setMatchEntryValue(packetTypeCase)
                 .build();
     }
-}
\ No newline at end of file
+}
index 64d9e629dcb1b3f31cbe69790ab8f0735a92f911..374e729489998289627ba6e027927eb7f6801e2e 100644 (file)
@@ -5,7 +5,6 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowjava.protocol.impl.serialization.match;
 
 import static org.junit.Assert.assertEquals;
@@ -14,7 +13,6 @@ import static org.junit.Assert.assertTrue;
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.PooledByteBufAllocator;
 import org.junit.Test;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.PortNumber;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.OpenflowBasicClass;
@@ -82,7 +80,7 @@ public class OxmSctpDstSerializerTest {
      */
     @Test
     public void testGetValueLength() {
-        assertEquals("Wrong value length", EncodeConstants.SIZE_OF_SHORT_IN_BYTES, serializer.getValueLength());
+        assertEquals("Wrong value length", Short.BYTES, serializer.getValueLength());
     }
 
     private static MatchEntryBuilder prepareMatchEntry(int value) {
@@ -108,6 +106,6 @@ public class OxmSctpDstSerializerTest {
         short fieldAndMask = buffer.readUnsignedByte();
         assertEquals("Wrong oxm-field", OxmMatchConstants.SCTP_DST, fieldAndMask >>> 1);
         assertEquals("Wrong hasMask", hasMask, (fieldAndMask & 1) != 0);
-        assertEquals("Wrong length", EncodeConstants.SIZE_OF_SHORT_IN_BYTES, buffer.readUnsignedByte());
+        assertEquals("Wrong length", Short.BYTES, buffer.readUnsignedByte());
     }
 }
index 607ee8fcead741c6383422f3204e5b6d42259fbf..06f036e99d1296d4ce39898356224310b394fecc 100644 (file)
@@ -5,7 +5,6 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowjava.protocol.impl.serialization.match;
 
 import static org.junit.Assert.assertEquals;
@@ -14,7 +13,6 @@ import static org.junit.Assert.assertTrue;
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.PooledByteBufAllocator;
 import org.junit.Test;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.PortNumber;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.OpenflowBasicClass;
@@ -82,7 +80,7 @@ public class OxmSctpSrcSerializerTest {
      */
     @Test
     public void testGetValueLength() {
-        assertEquals("Wrong value length", EncodeConstants.SIZE_OF_SHORT_IN_BYTES, serializer.getValueLength());
+        assertEquals("Wrong value length", Short.BYTES, serializer.getValueLength());
     }
 
     private static MatchEntryBuilder prepareMatchEntry(int value) {
@@ -108,6 +106,6 @@ public class OxmSctpSrcSerializerTest {
         short fieldAndMask = buffer.readUnsignedByte();
         assertEquals("Wrong oxm-field", OxmMatchConstants.SCTP_SRC, fieldAndMask >>> 1);
         assertEquals("Wrong hasMask", hasMask, (fieldAndMask & 1) != 0);
-        assertEquals("Wrong length", EncodeConstants.SIZE_OF_SHORT_IN_BYTES, buffer.readUnsignedByte());
+        assertEquals("Wrong length", Short.BYTES, buffer.readUnsignedByte());
     }
 }
index fad1de067bc054b668ca124428e818b5e78f48a6..ff17a6b9e43ee19df0de66ba7e08156a5ed72225 100644 (file)
@@ -5,7 +5,6 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowjava.protocol.impl.serialization.match;
 
 import static org.junit.Assert.assertEquals;
@@ -14,7 +13,6 @@ import static org.junit.Assert.assertTrue;
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.PooledByteBufAllocator;
 import org.junit.Test;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.PortNumber;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.OpenflowBasicClass;
@@ -82,7 +80,7 @@ public class OxmTcpDstSerializerTest {
      */
     @Test
     public void testGetValueLength() {
-        assertEquals("Wrong value length", EncodeConstants.SIZE_OF_SHORT_IN_BYTES, serializer.getValueLength());
+        assertEquals("Wrong value length", Short.BYTES, serializer.getValueLength());
     }
 
     private static MatchEntryBuilder prepareMatchEntry(int value) {
@@ -108,6 +106,6 @@ public class OxmTcpDstSerializerTest {
         short fieldAndMask = buffer.readUnsignedByte();
         assertEquals("Wrong oxm-field", OxmMatchConstants.TCP_DST, fieldAndMask >>> 1);
         assertEquals("Wrong hasMask", hasMask, (fieldAndMask & 1) != 0);
-        assertEquals("Wrong length", EncodeConstants.SIZE_OF_SHORT_IN_BYTES, buffer.readUnsignedByte());
+        assertEquals("Wrong length", Short.BYTES, buffer.readUnsignedByte());
     }
 }
index b284e622fa04902920336b5cad339d547c35ce1d..0789b416b35443866282506282c5599b03046450 100644 (file)
@@ -5,7 +5,6 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowjava.protocol.impl.serialization.match;
 
 import static org.junit.Assert.assertEquals;
@@ -14,7 +13,6 @@ import static org.junit.Assert.assertTrue;
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.PooledByteBufAllocator;
 import org.junit.Test;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.PortNumber;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.OpenflowBasicClass;
@@ -82,7 +80,7 @@ public class OxmTcpSrcSerializerTest {
      */
     @Test
     public void testGetValueLength() {
-        assertEquals("Wrong value length", EncodeConstants.SIZE_OF_SHORT_IN_BYTES, serializer.getValueLength());
+        assertEquals("Wrong value length", Short.BYTES, serializer.getValueLength());
     }
 
     private static MatchEntryBuilder prepareMatchEntry(int value) {
@@ -108,6 +106,6 @@ public class OxmTcpSrcSerializerTest {
         short fieldAndMask = buffer.readUnsignedByte();
         assertEquals("Wrong oxm-field", OxmMatchConstants.TCP_SRC, fieldAndMask >>> 1);
         assertEquals("Wrong hasMask", hasMask, (fieldAndMask & 1) != 0);
-        assertEquals("Wrong length", EncodeConstants.SIZE_OF_SHORT_IN_BYTES, buffer.readUnsignedByte());
+        assertEquals("Wrong length", Short.BYTES, buffer.readUnsignedByte());
     }
 }
index 61580d8cb79069ce66541286f0b51495efbc8e95..f7e3d675afef17d2156bf8d7ede9f7bfaca880bb 100644 (file)
@@ -5,7 +5,6 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowjava.protocol.impl.serialization.match;
 
 import static org.junit.Assert.assertEquals;
@@ -15,7 +14,6 @@ import io.netty.buffer.ByteBuf;
 import io.netty.buffer.PooledByteBufAllocator;
 import org.junit.Assert;
 import org.junit.Test;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.OpenflowBasicClass;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.TunnelId;
@@ -119,7 +117,7 @@ public class OxmTunnelIdSerializerTest {
      */
     @Test
     public void testGetValueLength() {
-        assertEquals("Wrong value length", EncodeConstants.SIZE_OF_LONG_IN_BYTES, serializer.getValueLength());
+        assertEquals("Wrong value length", Long.BYTES, serializer.getValueLength());
     }
 
     private static MatchEntryBuilder prepareMatchEntry(boolean hasMask, byte[] value) {
@@ -149,9 +147,9 @@ public class OxmTunnelIdSerializerTest {
         assertEquals("Wrong oxm-field", OxmMatchConstants.TUNNEL_ID, fieldAndMask >>> 1);
         assertEquals("Wrong hasMask", hasMask, (fieldAndMask & 1) != 0);
         if (hasMask) {
-            assertEquals("Wrong length", 2 * EncodeConstants.SIZE_OF_LONG_IN_BYTES, buffer.readUnsignedByte());
+            assertEquals("Wrong length", 2 * Long.BYTES, buffer.readUnsignedByte());
         } else {
-            assertEquals("Wrong length", EncodeConstants.SIZE_OF_LONG_IN_BYTES, buffer.readUnsignedByte());
+            assertEquals("Wrong length", Long.BYTES, buffer.readUnsignedByte());
         }
     }
 }
index 0030b9ae00e7f0bf85c09790e5d1cee62391abca..76356edf191af3b3fa92d3a63e012ccf77372f2d 100644 (file)
@@ -5,7 +5,6 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowjava.protocol.impl.serialization.match;
 
 import static org.junit.Assert.assertEquals;
@@ -14,7 +13,6 @@ import static org.junit.Assert.assertTrue;
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.PooledByteBufAllocator;
 import org.junit.Test;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.PortNumber;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.OpenflowBasicClass;
@@ -82,7 +80,7 @@ public class OxmUdpDstSerializerTest {
      */
     @Test
     public void testGetValueLength() {
-        assertEquals("Wrong value length", EncodeConstants.SIZE_OF_SHORT_IN_BYTES, serializer.getValueLength());
+        assertEquals("Wrong value length", Short.BYTES, serializer.getValueLength());
     }
 
     private static MatchEntryBuilder prepareMatchEntry(int value) {
@@ -108,6 +106,6 @@ public class OxmUdpDstSerializerTest {
         short fieldAndMask = buffer.readUnsignedByte();
         assertEquals("Wrong oxm-field", OxmMatchConstants.UDP_DST, fieldAndMask >>> 1);
         assertEquals("Wrong hasMask", hasMask, (fieldAndMask & 1) != 0);
-        assertEquals("Wrong length", EncodeConstants.SIZE_OF_SHORT_IN_BYTES, buffer.readUnsignedByte());
+        assertEquals("Wrong length", Short.BYTES, buffer.readUnsignedByte());
     }
 }
index 8dacb263018ae8f690f541c8004c1755b5d0cc3c..256271ce6f1802c9ec36e3ab1d43fc2c0f7f35c8 100644 (file)
@@ -5,7 +5,6 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowjava.protocol.impl.serialization.match;
 
 import static org.junit.Assert.assertEquals;
@@ -14,7 +13,6 @@ import static org.junit.Assert.assertTrue;
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.PooledByteBufAllocator;
 import org.junit.Test;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.PortNumber;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.OpenflowBasicClass;
@@ -82,7 +80,7 @@ public class OxmUdpSrcSerializerTest {
      */
     @Test
     public void testGetValueLength() {
-        assertEquals("Wrong value length", EncodeConstants.SIZE_OF_SHORT_IN_BYTES, serializer.getValueLength());
+        assertEquals("Wrong value length", Short.BYTES, serializer.getValueLength());
     }
 
     private static MatchEntryBuilder prepareMatchEntry(int value) {
@@ -108,6 +106,6 @@ public class OxmUdpSrcSerializerTest {
         short fieldAndMask = buffer.readUnsignedByte();
         assertEquals("Wrong oxm-field", OxmMatchConstants.UDP_SRC, fieldAndMask >>> 1);
         assertEquals("Wrong hasMask", hasMask, (fieldAndMask & 1) != 0);
-        assertEquals("Wrong length", EncodeConstants.SIZE_OF_SHORT_IN_BYTES, buffer.readUnsignedByte());
+        assertEquals("Wrong length", Short.BYTES, buffer.readUnsignedByte());
     }
 }
index 25306560d2522ab2b9478a4786c01ff00a81ec17..211427c27a9cb3e0c349cba706150115a0452165 100644 (file)
@@ -5,7 +5,6 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowjava.protocol.impl.serialization.match;
 
 import static org.junit.Assert.assertEquals;
@@ -14,7 +13,6 @@ import static org.junit.Assert.assertTrue;
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.PooledByteBufAllocator;
 import org.junit.Test;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.OpenflowBasicClass;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.VlanPcp;
@@ -81,7 +79,7 @@ public class OxmVlanPcpSerializerTest {
      */
     @Test
     public void testGetValueLength() {
-        assertEquals("Wrong value length", EncodeConstants.SIZE_OF_BYTE_IN_BYTES, serializer.getValueLength());
+        assertEquals("Wrong value length", Byte.BYTES, serializer.getValueLength());
     }
 
     private static MatchEntryBuilder prepareVlanPcpMatchEntry(short value) {
@@ -107,6 +105,6 @@ public class OxmVlanPcpSerializerTest {
         short fieldAndMask = buffer.readUnsignedByte();
         assertEquals("Wrong oxm-field", OxmMatchConstants.VLAN_PCP, fieldAndMask >>> 1);
         assertEquals("Wrong hasMask", hasMask, (fieldAndMask & 1) != 0);
-        assertEquals("Wrong length", EncodeConstants.SIZE_OF_BYTE_IN_BYTES, buffer.readUnsignedByte());
+        assertEquals("Wrong length", Byte.BYTES, buffer.readUnsignedByte());
     }
 }
index 1dd0adc1399bd1c21d1be1052f5d16e7be8140d4..a17f36e134d8673fe8bded72122489460f4b6996 100644 (file)
@@ -5,7 +5,6 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowjava.protocol.impl.serialization.match;
 
 import static org.junit.Assert.assertEquals;
@@ -15,7 +14,6 @@ import io.netty.buffer.ByteBuf;
 import io.netty.buffer.PooledByteBufAllocator;
 import org.junit.Assert;
 import org.junit.Test;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.OpenflowBasicClass;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.VlanVid;
@@ -114,7 +112,7 @@ public class OxmVlanVidSerializerTest {
      */
     @Test
     public void testGetValueLength() {
-        assertEquals("Wrong value length", EncodeConstants.SIZE_OF_SHORT_IN_BYTES, serializer.getValueLength());
+        assertEquals("Wrong value length", Short.BYTES, serializer.getValueLength());
     }
 
     private static MatchEntryBuilder prepareVlanVidMatchEntry(boolean hasMask, boolean cfiBit) {
@@ -145,9 +143,9 @@ public class OxmVlanVidSerializerTest {
         assertEquals("Wrong oxm-field", OxmMatchConstants.VLAN_VID, fieldAndMask >>> 1);
         assertEquals("Wrong hasMask", hasMask, (fieldAndMask & 1) != 0);
         if (hasMask) {
-            assertEquals("Wrong length", EncodeConstants.SIZE_OF_INT_IN_BYTES, buffer.readUnsignedByte());
+            assertEquals("Wrong length", Integer.BYTES, buffer.readUnsignedByte());
         } else {
-            assertEquals("Wrong length", EncodeConstants.SIZE_OF_SHORT_IN_BYTES, buffer.readUnsignedByte());
+            assertEquals("Wrong length", Short.BYTES, buffer.readUnsignedByte());
         }
     }
 }
index d3533f00416598702a5fc0999ab3ac4271ba2902..6dc54e94fa4a16effc6b317e963e1c2cf93f9f83 100644 (file)
@@ -102,10 +102,10 @@ public class OF13MatchSerializerTest {
         matchSerializer.serialize(match, out);
 
         Assert.assertEquals("Wrong type", 1, out.readUnsignedShort());
-        out.skipBytes(EncodeConstants.SIZE_OF_SHORT_IN_BYTES);
+        out.skipBytes(Short.BYTES);
         Assert.assertEquals("Wrong class", 0x8000, out.readUnsignedShort());
         Assert.assertEquals("Wrong field and mask", 22, out.readUnsignedByte());
-        out.skipBytes(EncodeConstants.SIZE_OF_BYTE_IN_BYTES);
+        out.skipBytes(Byte.BYTES);
         Assert.assertEquals("Wrong ip address (first number)", 1, out.readUnsignedByte());
         Assert.assertEquals("Wrong ip address (second number)", 2, out.readUnsignedByte());
         Assert.assertEquals("Wrong ip address (third number)", 3, out.readUnsignedByte());
@@ -181,7 +181,7 @@ public class OF13MatchSerializerTest {
         matchSerializer.serialize(match, out);
 
         Assert.assertEquals("Wrong type", 1, out.readUnsignedShort());
-        out.skipBytes(EncodeConstants.SIZE_OF_SHORT_IN_BYTES);
+        out.skipBytes(Short.BYTES);
         Assert.assertEquals("Wrong class", 0x8000, out.readUnsignedShort());
         Assert.assertEquals("Wrong field and mask", 52, out.readUnsignedByte());
         Assert.assertEquals("Wrong entry length", 16, out.readUnsignedByte());
@@ -275,10 +275,10 @@ public class OF13MatchSerializerTest {
         matchSerializer.serialize(match, out);
 
         Assert.assertEquals("Wrong type", 1, out.readUnsignedShort());
-        out.skipBytes(EncodeConstants.SIZE_OF_SHORT_IN_BYTES);
+        out.skipBytes(Short.BYTES);
         Assert.assertEquals("Wrong class", 0x8000, out.readUnsignedShort());
         Assert.assertEquals("Wrong field and mask", 56, out.readUnsignedByte());
-        out.skipBytes(EncodeConstants.SIZE_OF_BYTE_IN_BYTES);
+        out.skipBytes(Byte.BYTES);
         byte[] label = new byte[4];
         out.readBytes(label);
 
@@ -297,10 +297,10 @@ public class OF13MatchSerializerTest {
         matchSerializer.serialize(match, out);
 
         Assert.assertEquals("Wrong type", 1, out.readUnsignedShort());
-        out.skipBytes(EncodeConstants.SIZE_OF_SHORT_IN_BYTES);
+        out.skipBytes(Short.BYTES);
         Assert.assertEquals("Wrong class", 0x8000, out.readUnsignedShort());
         Assert.assertEquals("Wrong field and mask", 57, out.readUnsignedByte());
-        out.skipBytes(EncodeConstants.SIZE_OF_BYTE_IN_BYTES);
+        out.skipBytes(Byte.BYTES);
         byte[] label = new byte[4];
         out.readBytes(label);
         Assert.assertArrayEquals("Wrong ipv6FLabel", new byte[]{0, 0x0f, (byte) 0x9e, (byte) 0x8d}, label);
index 4c85aa6dd9a054c663cd216e141ea0ff4b1fa4f3..da0bf849b229a5bdf00d0568f067fab0aeeb1be4 100644 (file)
@@ -262,7 +262,7 @@ public abstract class ByteBufUtils {
         try {
             int offset = 0;
             for (int i = 0; i < EncodeConstants.MAC_ADDRESS_LENGTH - 1; ++i) {
-                if (mac[offset + EncodeConstants.SIZE_OF_BYTE_IN_BYTES] == ':') {
+                if (mac[offset + Byte.BYTES] == ':') {
                     result[i] = UnsignedBytes.checkedCast(hexValue(mac[offset]));
                     offset++;
                 } else {
index df5f2c61a6698668b78fc2de56d4a776eb59a74a..14a05c4c87e0b67be8b646b8201a7dbc9114d102 100644 (file)
@@ -5,24 +5,20 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.impl.protocol.deserialization.action;
 
 import io.netty.buffer.ByteBuf;
 import org.opendaylight.openflowjava.protocol.api.extensibility.HeaderDeserializer;
 import org.opendaylight.openflowjava.protocol.api.extensibility.OFDeserializer;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action;
 
 public abstract class AbstractActionDeserializer implements OFDeserializer<Action>, HeaderDeserializer<Action> {
-
     /**
      * Skip first few bytes of action message because they are irrelevant.
      *
      * @param message Openflow buffered message
      **/
     protected static void processHeader(ByteBuf message) {
-        message.skipBytes(2 * EncodeConstants.SIZE_OF_SHORT_IN_BYTES);
+        message.skipBytes(2 * Short.BYTES);
     }
-
 }
index 17bd7b38b3cdbd09985cd14aae590530daa41cbf..b74649238605e9df1de3e342b74c50d3a19c14a9 100644 (file)
@@ -42,7 +42,7 @@ public abstract class AbstractActionInstructionDeserializer extends AbstractInst
      * @return instruction length
      **/
     protected static int readHeader(ByteBuf message) {
-        message.skipBytes(EncodeConstants.SIZE_OF_SHORT_IN_BYTES);
+        message.skipBytes(Short.BYTES);
         return message.readUnsignedShort();
     }
 
index 08252a310b91e9f86955208e39fb9e144dc3bc3d..08f95c298b7bc36bcd8c70c6433c5a929262fedb 100644 (file)
@@ -5,25 +5,21 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.impl.protocol.deserialization.instruction;
 
 import io.netty.buffer.ByteBuf;
 import org.opendaylight.openflowjava.protocol.api.extensibility.HeaderDeserializer;
 import org.opendaylight.openflowjava.protocol.api.extensibility.OFDeserializer;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.Instruction;
 
 public abstract class AbstractInstructionDeserializer implements OFDeserializer<Instruction>,
         HeaderDeserializer<Instruction> {
-
     /**
      * Skip first few bytes of instruction message because they are irrelevant.
      *
      * @param message Openflow buffered message
      **/
     protected static void processHeader(ByteBuf message) {
-        message.skipBytes(2 * EncodeConstants.SIZE_OF_SHORT_IN_BYTES);
+        message.skipBytes(2 * Short.BYTES);
     }
-
 }
index c3751d8a6ae21408b8b9cff512dfbc9c611f6570..103029bc550546b292eb758030e84b5ea64ef11c 100644 (file)
@@ -5,27 +5,24 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.impl.protocol.deserialization.instruction;
 
 import io.netty.buffer.ByteBuf;
 import java.math.BigInteger;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.impl.util.InstructionConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.Instruction;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.instruction.WriteMetadataCaseBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.instruction.write.metadata._case.WriteMetadataBuilder;
 
 public class WriteMetadataInstructionDeserializer extends AbstractInstructionDeserializer {
-
     @Override
     public Instruction deserialize(ByteBuf message) {
         processHeader(message);
         message.skipBytes(InstructionConstants.PADDING_IN_WRITE_METADATA);
 
-        final byte[] meta = new byte[EncodeConstants.SIZE_OF_LONG_IN_BYTES];
+        final byte[] meta = new byte[Long.BYTES];
         message.readBytes(meta);
-        final byte[] metaMask = new byte[EncodeConstants.SIZE_OF_LONG_IN_BYTES];
+        final byte[] metaMask = new byte[Long.BYTES];
         message.readBytes(metaMask);
 
         return new WriteMetadataCaseBuilder()
@@ -41,5 +38,4 @@ public class WriteMetadataInstructionDeserializer extends AbstractInstructionDes
         processHeader(message);
         return new WriteMetadataCaseBuilder().build();
     }
-
 }
index e7a80485d48f0fc08e4f3f3b25c593e6c94265f8..1aa97402051a478cc0b399d2bfba8658aa1b8c3d 100644 (file)
@@ -26,9 +26,9 @@ public abstract class AbstractMatchEntryDeserializer implements MatchEntryDeseri
      * @return true if match entry has mask, false otherwise
      */
     protected static boolean processHeader(ByteBuf in) {
-        in.skipBytes(EncodeConstants.SIZE_OF_SHORT_IN_BYTES); // skip oxm_class
+        in.skipBytes(Short.BYTES); // skip oxm_class
         boolean hasMask = (in.readUnsignedByte() & 1) != 0;
-        in.skipBytes(EncodeConstants.SIZE_OF_BYTE_IN_BYTES); // skip match entry length
+        in.skipBytes(Byte.BYTES); // skip match entry length
         return hasMask;
     }
 
index dec180151aefe6549cf041b5779f63c287a7de1e..cb05e21afd4002a99959f15ba198708ded813f34 100644 (file)
@@ -8,7 +8,6 @@
 package org.opendaylight.openflowplugin.impl.protocol.deserialization.match;
 
 import io.netty.buffer.ByteBuf;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.impl.deserialization.match.OxmDeserializerHelper;
 import org.opendaylight.openflowplugin.openflow.md.util.ByteUtil;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder;
@@ -17,7 +16,6 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026
 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._3.match.Ipv6MatchBuilder;
 
 public class Ipv6ExtHeaderEntryDeserializer extends AbstractMatchEntryDeserializer {
-
     @Override
     public void deserializeEntry(ByteBuf message, MatchBuilder builder) {
         final boolean hasMask = processHeader(message);
@@ -25,7 +23,7 @@ public class Ipv6ExtHeaderEntryDeserializer extends AbstractMatchEntryDeserializ
             .setIpv6Exthdr(message.readUnsignedShort());
 
         if (hasMask) {
-            final byte[] mask = OxmDeserializerHelper.convertMask(message, EncodeConstants.SIZE_OF_SHORT_IN_BYTES);
+            final byte[] mask = OxmDeserializerHelper.convertMask(message, Short.BYTES);
             extHeaderBuilder.setIpv6ExthdrMask(ByteUtil.bytesToUnsignedShort(mask));
         }
 
index 5da7493b83864e8a9dc45fa6f958b7c0a8b485c3..9bec28542baf93d85a25def4663902b7d9e0f977 100644 (file)
@@ -8,7 +8,6 @@
 package org.opendaylight.openflowplugin.impl.protocol.deserialization.match;
 
 import io.netty.buffer.ByteBuf;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.impl.deserialization.match.OxmDeserializerHelper;
 import org.opendaylight.openflowplugin.openflow.md.util.ByteUtil;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv6FlowLabel;
@@ -18,7 +17,6 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026
 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._3.match.Ipv6MatchBuilder;
 
 public class Ipv6FlabelEntryDeserializer extends AbstractMatchEntryDeserializer {
-
     @Override
     public void deserializeEntry(ByteBuf message, MatchBuilder builder) {
         final boolean hasMask = processHeader(message);
@@ -26,7 +24,7 @@ public class Ipv6FlabelEntryDeserializer extends AbstractMatchEntryDeserializer
             .setIpv6Flabel(new Ipv6FlowLabel(message.readUnsignedInt()));
 
         if (hasMask) {
-            final byte[] mask = OxmDeserializerHelper.convertMask(message, EncodeConstants.SIZE_OF_INT_IN_BYTES);
+            final byte[] mask = OxmDeserializerHelper.convertMask(message, Integer.BYTES);
             ipv6labelBuilder.setFlabelMask(new Ipv6FlowLabel(ByteUtil.bytesToUnsignedInt(mask)));
         }
 
index 2fcf00cee3c1db187b53d0cb0c968be391627ec7..5fc45f611743b5f423d07f38d25f9cd8ed49dbf5 100644 (file)
@@ -52,7 +52,7 @@ public class MatchDeserializer implements OFDeserializer<Match>, HeaderDeseriali
         final int length = inBuffer.readUnsignedShort();
 
         final int startIndex = inBuffer.readerIndex();
-        final int entriesLength = length - 2 * EncodeConstants.SIZE_OF_SHORT_IN_BYTES;
+        final int entriesLength = length - 2 * Short.BYTES;
 
         while (inBuffer.readerIndex() - startIndex < entriesLength) {
             deserializeEntry(inBuffer, builder);
@@ -80,17 +80,13 @@ public class MatchDeserializer implements OFDeserializer<Match>, HeaderDeseriali
             return;
         }
         int oxmClass = inBuffer.getUnsignedShort(inBuffer.readerIndex());
-        int oxmField = inBuffer.getUnsignedByte(inBuffer.readerIndex()
-                + EncodeConstants.SIZE_OF_SHORT_IN_BYTES) >>> 1;
+        int oxmField = inBuffer.getUnsignedByte(inBuffer.readerIndex() + Short.BYTES) >>> 1;
 
         final MatchEntryDeserializerKey key = new MatchEntryDeserializerKey(
                 EncodeConstants.OF13_VERSION_ID, oxmClass, oxmField);
 
         if (oxmClass == EncodeConstants.EXPERIMENTER_VALUE) {
-            long expId = inBuffer.getUnsignedInt(inBuffer.readerIndex()
-                    + EncodeConstants.SIZE_OF_SHORT_IN_BYTES
-                    + 2 * EncodeConstants.SIZE_OF_BYTE_IN_BYTES);
-
+            long expId = inBuffer.getUnsignedInt(inBuffer.readerIndex() + Short.BYTES + 2 * Byte.BYTES);
             key.setExperimenterId(Uint32.valueOf(expId));
         }
 
index 61717d32d4afc3e566ae032fe22db4fbb6a5a872..c88a4b37adaa22755e58ccc9b24e4ce9bda3c376 100644 (file)
@@ -9,24 +9,22 @@ package org.opendaylight.openflowplugin.impl.protocol.deserialization.match;
 
 import io.netty.buffer.ByteBuf;
 import java.math.BigInteger;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.Metadata;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.MetadataBuilder;
 
 public class MetadataEntryDeserializer extends AbstractMatchEntryDeserializer {
-
     @Override
     public void deserializeEntry(ByteBuf message, MatchBuilder builder) {
         final boolean hasMask = processHeader(message);
         final Metadata metadata = builder.getMetadata();
-        final byte[] metaByte = new byte[EncodeConstants.SIZE_OF_LONG_IN_BYTES];
+        final byte[] metaByte = new byte[Long.BYTES];
         message.readBytes(metaByte);
         final MetadataBuilder metadataBuilder = new MetadataBuilder()
                 .setMetadata(new BigInteger(1, metaByte));
 
         if (hasMask) {
-            final byte[] metaMask = new byte[EncodeConstants.SIZE_OF_LONG_IN_BYTES];
+            final byte[] metaMask = new byte[Long.BYTES];
             message.readBytes(metaMask);
             metadataBuilder.setMetadataMask(new BigInteger(1, metaMask));
         }
index 041fb3d088a103e0a81ad7013dcaec2d305384a6..61b1f45af8528131e3be60677d3d1457d7fd5590 100644 (file)
@@ -9,23 +9,21 @@ package org.opendaylight.openflowplugin.impl.protocol.deserialization.match;
 
 import io.netty.buffer.ByteBuf;
 import java.math.BigInteger;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.TunnelBuilder;
 
 public class TunnelIdEntryDeserializer extends AbstractMatchEntryDeserializer {
-
     @Override
     public void deserializeEntry(ByteBuf message, MatchBuilder builder) {
         final boolean hasMask = processHeader(message);
 
-        final byte[] tunnelId = new byte[EncodeConstants.SIZE_OF_LONG_IN_BYTES];
+        final byte[] tunnelId = new byte[Long.BYTES];
         message.readBytes(tunnelId);
         final TunnelBuilder tunnelBuilder = new TunnelBuilder()
             .setTunnelId(new BigInteger(1, tunnelId));
 
         if (hasMask) {
-            final byte[] tunnelMask = new byte[EncodeConstants.SIZE_OF_LONG_IN_BYTES];
+            final byte[] tunnelMask = new byte[Long.BYTES];
             message.readBytes(tunnelMask);
             tunnelBuilder.setTunnelMask(new BigInteger(1, tunnelMask));
         }
index 9b7a69e1eb19fc341eee8fdb764bece84090003a..5886a9a018872a13f548cbc842674c4be93c99a3 100644 (file)
@@ -8,14 +8,12 @@
 package org.opendaylight.openflowplugin.impl.protocol.deserialization.match;
 
 import io.netty.buffer.ByteBuf;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.l2.types.rev130827.VlanId;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.VlanMatchBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.vlan.match.fields.VlanIdBuilder;
 
 public class VlanVidEntryDeserializer extends AbstractMatchEntryDeserializer {
-
     @Override
     public void deserializeEntry(ByteBuf message, MatchBuilder builder) {
         final boolean hasMask = processHeader(message);
@@ -23,7 +21,7 @@ public class VlanVidEntryDeserializer extends AbstractMatchEntryDeserializer {
         final int vlanVidValue = message.readUnsignedShort();
 
         if (hasMask) {
-            message.skipBytes(EncodeConstants.SIZE_OF_SHORT_IN_BYTES); // Skip mask
+            message.skipBytes(Short.BYTES); // Skip mask
             vlanIdBuilder
                     .setVlanId(new VlanId(0))
                     .setVlanIdPresent(true);
index 3fa354f0a3982505e1e1eb62473b7b22e9b17519..8a6567c38f680ccef3e1a48704b83d9630f75019 100644 (file)
@@ -100,8 +100,7 @@ public class FlowMessageDeserializer implements OFDeserializer<FlowMessage>, Des
                     Long expId = null;
 
                     if (EncodeConstants.EXPERIMENTER_VALUE == type) {
-                        expId = message.getUnsignedInt(message.readerIndex()
-                                + 2 * EncodeConstants.SIZE_OF_SHORT_IN_BYTES);
+                        expId = message.getUnsignedInt(message.readerIndex() + 2 * Short.BYTES);
                     }
 
                     deserializer = Preconditions.checkNotNull(registry).getDeserializer(
index f7fcc9641b54175b023e67ab871446d65c540a29..22ce7d96f26833a0f05bfe7dff44d7ef95a85a48 100644 (file)
@@ -88,8 +88,7 @@ public class MeterMessageDeserializer implements OFDeserializer<MeterMessage>, D
                 }
                 case OFPMBTEXPERIMENTER: {
                     // TODO: Finish meter band experimenter deserialization
-                    long expId =
-                            message.getUnsignedInt(message.readerIndex() + 2 * EncodeConstants.SIZE_OF_INT_IN_BYTES);
+                    long expId = message.getUnsignedInt(message.readerIndex() + 2 * Integer.BYTES);
                     message.readerIndex(bandStartIndex);
 
                     OFDeserializer<Experimenter> deserializer = registry.getDeserializer(
index c4f6f09044dcd91a05ec807a6d2930eae0fc35ee..dba93fda2416337a357ef3f2677e9758aed0e5db 100644 (file)
@@ -56,7 +56,7 @@ public class PacketInMessageDeserializer implements OFDeserializer<PacketInMessa
                                 .forValue(message.readUnsignedByte())))
                 .setTableId(new TableId(message.readUnsignedByte()));
 
-        final byte[] cookie = new byte[EncodeConstants.SIZE_OF_LONG_IN_BYTES];
+        final byte[] cookie = new byte[Long.BYTES];
         message.readBytes(cookie);
 
         packetInMessageBuilder
index 45a02f8eeac78e4391b6120e7f06d42e53e58906..f5f262ebabe846001d20c93036e2d73c9d4869c3 100644 (file)
@@ -36,7 +36,7 @@ public class PortMessageDeserializer implements OFDeserializer<PortMessage> {
         builder.setHardwareAddress(ByteBufUtils.readIetfMacAddress(message));
         message.skipBytes(PADDING_IN_PORT_MOD_MESSAGE_2);
         builder.setConfiguration(readPortConfig(message));
-        message.skipBytes(EncodeConstants.SIZE_OF_INT_IN_BYTES); // Skip mask
+        message.skipBytes(Integer.BYTES); // Skip mask
         builder.setAdvertisedFeatures(readPortFeatures(message));
         message.skipBytes(PADDING_IN_PORT_MOD_MESSAGE_3);
         return builder.build();
index 723bc4440a41d16b83b9c33e0514277ba3881c0c..c7ab4a3d6e4dba9f2ed56dee3c63c561befd34b4 100644 (file)
@@ -5,27 +5,24 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.impl.protocol.deserialization.multipart;
 
 import io.netty.buffer.ByteBuf;
 import java.math.BigInteger;
 import org.opendaylight.openflowjava.protocol.api.extensibility.OFDeserializer;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Counter32;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Counter64;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.multipart.reply.multipart.reply.body.MultipartReplyFlowAggregateStatsBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.multipart.types.rev170112.multipart.reply.MultipartReplyBody;
 
 public class MultipartReplyFlowAggregateStatsDeserializer implements OFDeserializer<MultipartReplyBody> {
-
     private static final byte PADDING_IN_AGGREGATE_HEADER = 4;
 
     @Override
     public MultipartReplyBody deserialize(ByteBuf message) {
-        final byte[] packetCount = new byte[EncodeConstants.SIZE_OF_LONG_IN_BYTES];
+        final byte[] packetCount = new byte[Long.BYTES];
         message.readBytes(packetCount);
-        final byte[] byteCount = new byte[EncodeConstants.SIZE_OF_LONG_IN_BYTES];
+        final byte[] byteCount = new byte[Long.BYTES];
         message.readBytes(byteCount);
 
         final MultipartReplyFlowAggregateStatsBuilder builder = new MultipartReplyFlowAggregateStatsBuilder()
@@ -36,5 +33,4 @@ public class MultipartReplyFlowAggregateStatsDeserializer implements OFDeseriali
         message.skipBytes(PADDING_IN_AGGREGATE_HEADER);
         return builder.build();
     }
-
 }
index 694ab0beff9d9460368d45cb4a4ab25e26bf2d21..b9560995593ecf3b0bf933adea242bd2f73d4103 100644 (file)
@@ -56,7 +56,7 @@ public class MultipartReplyFlowStatsDeserializer implements OFDeserializer<Multi
         while (message.readableBytes() > 0) {
             final FlowAndStatisticsMapListBuilder itemBuilder = new FlowAndStatisticsMapListBuilder();
             final int itemLength = message.readUnsignedShort();
-            final ByteBuf itemMessage = message.readSlice(itemLength - EncodeConstants.SIZE_OF_SHORT_IN_BYTES);
+            final ByteBuf itemMessage = message.readSlice(itemLength - Short.BYTES);
 
             itemBuilder.setTableId(itemMessage.readUnsignedByte());
             itemMessage.skipBytes(PADDING_IN_FLOW_STATS_HEADER_01);
@@ -73,11 +73,11 @@ public class MultipartReplyFlowStatsDeserializer implements OFDeserializer<Multi
 
             itemMessage.skipBytes(PADDING_IN_FLOW_STATS_HEADER_02);
 
-            final byte[] cookie = new byte[EncodeConstants.SIZE_OF_LONG_IN_BYTES];
+            final byte[] cookie = new byte[Long.BYTES];
             itemMessage.readBytes(cookie);
-            final byte[] packetCount = new byte[EncodeConstants.SIZE_OF_LONG_IN_BYTES];
+            final byte[] packetCount = new byte[Long.BYTES];
             itemMessage.readBytes(packetCount);
-            final byte[] byteCount = new byte[EncodeConstants.SIZE_OF_LONG_IN_BYTES];
+            final byte[] byteCount = new byte[Long.BYTES];
             itemMessage.readBytes(byteCount);
 
             itemBuilder
index 6d567e9251f64ff47f768a02391fb97cd35e0c29..d3672f0dfed5d138f2f00b5b9a6b86e2252adad4 100644 (file)
@@ -5,7 +5,6 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.impl.protocol.deserialization.multipart;
 
 import io.netty.buffer.ByteBuf;
@@ -13,7 +12,6 @@ import java.math.BigInteger;
 import java.util.ArrayList;
 import java.util.List;
 import org.opendaylight.openflowjava.protocol.api.extensibility.OFDeserializer;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Counter32;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Counter64;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.table.statistics.rev131215.flow.table.and.statistics.map.FlowTableAndStatisticsMap;
@@ -24,7 +22,6 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.multipart.types.rev170112.m
 import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.TableId;
 
 public class MultipartReplyFlowTableStatsDeserializer implements OFDeserializer<MultipartReplyBody> {
-
     private static final byte PADDING_IN_TABLE_HEADER = 3;
 
     @Override
@@ -42,9 +39,9 @@ public class MultipartReplyFlowTableStatsDeserializer implements OFDeserializer<
                 .withKey(new FlowTableAndStatisticsMapKey(itemBuilder.getTableId()))
                 .setActiveFlows(new Counter32(message.readUnsignedInt()));
 
-            final byte[] packetsLooked = new byte[EncodeConstants.SIZE_OF_LONG_IN_BYTES];
+            final byte[] packetsLooked = new byte[Long.BYTES];
             message.readBytes(packetsLooked);
-            final byte[] packetsMatched = new byte[EncodeConstants.SIZE_OF_LONG_IN_BYTES];
+            final byte[] packetsMatched = new byte[Long.BYTES];
             message.readBytes(packetsMatched);
 
             items.add(itemBuilder
@@ -57,5 +54,4 @@ public class MultipartReplyFlowTableStatsDeserializer implements OFDeserializer<
             .setFlowTableAndStatisticsMap(items)
             .build();
     }
-
 }
index d7fe65939ae9334f16e913d6ff5340711255fbd2..b2801da028588e7f4d8dfaeb5a0188e2da531df1 100644 (file)
@@ -5,7 +5,6 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.impl.protocol.deserialization.multipart;
 
 import io.netty.buffer.ByteBuf;
@@ -13,7 +12,6 @@ import java.math.BigInteger;
 import java.util.ArrayList;
 import java.util.List;
 import org.opendaylight.openflowjava.protocol.api.extensibility.OFDeserializer;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Counter32;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Counter64;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.group.statistics.rev131111.multipart.reply.multipart.reply.body.MultipartReplyGroupStatsBuilder;
@@ -30,7 +28,6 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.group
 import org.opendaylight.yang.gen.v1.urn.opendaylight.multipart.types.rev170112.multipart.reply.MultipartReplyBody;
 
 public class MultipartReplyGroupStatsDeserializer implements OFDeserializer<MultipartReplyBody> {
-
     private static final byte PADDING_IN_GROUP_HEADER_01 = 2;
     private static final byte PADDING_IN_GROUP_HEADER_02 = 4;
     private static final byte GROUP_BODY_LENGTH = 40;
@@ -51,9 +48,9 @@ public class MultipartReplyGroupStatsDeserializer implements OFDeserializer<Mult
 
             message.skipBytes(PADDING_IN_GROUP_HEADER_02);
 
-            final byte[] packetCountg = new byte[EncodeConstants.SIZE_OF_LONG_IN_BYTES];
+            final byte[] packetCountg = new byte[Long.BYTES];
             message.readBytes(packetCountg);
-            final byte[] byteCountg = new byte[EncodeConstants.SIZE_OF_LONG_IN_BYTES];
+            final byte[] byteCountg = new byte[Long.BYTES];
             message.readBytes(byteCountg);
 
             itemBuilder
@@ -70,9 +67,9 @@ public class MultipartReplyGroupStatsDeserializer implements OFDeserializer<Mult
             long bucketKey = 0;
 
             while (actualLength < itemLength) {
-                final byte[] packetCount = new byte[EncodeConstants.SIZE_OF_LONG_IN_BYTES];
+                final byte[] packetCount = new byte[Long.BYTES];
                 message.readBytes(packetCount);
-                final byte[] byteCount = new byte[EncodeConstants.SIZE_OF_LONG_IN_BYTES];
+                final byte[] byteCount = new byte[Long.BYTES];
                 message.readBytes(byteCount);
 
                 subItems.add(new BucketCounterBuilder()
@@ -97,5 +94,4 @@ public class MultipartReplyGroupStatsDeserializer implements OFDeserializer<Mult
             .setGroupStats(items)
             .build();
     }
-
 }
index f40d05e840e558be27557a1ae8188f6e0700bdc0..30a2e13a66a1c9efa09622a78e8eb5674881442c 100644 (file)
@@ -100,8 +100,7 @@ public class MultipartReplyMeterConfigDeserializer implements OFDeserializer<Mul
 
                     case OFPMBTEXPERIMENTER:
                         // TODO: Finish meter band experimenter deserialization
-                        final long expId = message.getUnsignedInt(message.readerIndex() + 2 * EncodeConstants
-                                .SIZE_OF_INT_IN_BYTES);
+                        final long expId = message.getUnsignedInt(message.readerIndex() + 2 * Integer.BYTES);
                         message.readerIndex(itemStartIndex);
 
                         final OFDeserializer<Experimenter> deserializer = registry.getDeserializer(
index d43c6c1e93ab04804aed2d4caf716ea1f0056525..bdfd293ad54ad83a32d30f0949c33d02969fce04 100644 (file)
@@ -5,7 +5,6 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.impl.protocol.deserialization.multipart;
 
 import io.netty.buffer.ByteBuf;
@@ -13,7 +12,6 @@ import java.math.BigInteger;
 import java.util.ArrayList;
 import java.util.List;
 import org.opendaylight.openflowjava.protocol.api.extensibility.OFDeserializer;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Counter32;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Counter64;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.statistics.rev131111.multipart.reply.multipart.reply.body.MultipartReplyMeterStatsBuilder;
@@ -30,7 +28,6 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.types.rev130918.meter
 import org.opendaylight.yang.gen.v1.urn.opendaylight.multipart.types.rev170112.multipart.reply.MultipartReplyBody;
 
 public class MultipartReplyMeterStatsDeserializer implements OFDeserializer<MultipartReplyBody> {
-
     private static final byte PADDING_IN_METER_STATS_HEADER = 6;
     private static final byte METER_BODY_LENGTH = 40;
     private static final byte METER_BAND_STATS_LENGTH = 16;
@@ -51,9 +48,9 @@ public class MultipartReplyMeterStatsDeserializer implements OFDeserializer<Mult
                 .withKey(new MeterStatsKey(itemBuilder.getMeterId()))
                 .setFlowCount(new Counter32(message.readUnsignedInt()));
 
-            final byte[] packetCount = new byte[EncodeConstants.SIZE_OF_LONG_IN_BYTES];
+            final byte[] packetCount = new byte[Long.BYTES];
             message.readBytes(packetCount);
-            final byte[] byteCount = new byte[EncodeConstants.SIZE_OF_LONG_IN_BYTES];
+            final byte[] byteCount = new byte[Long.BYTES];
             message.readBytes(byteCount);
 
             itemBuilder
@@ -69,9 +66,9 @@ public class MultipartReplyMeterStatsDeserializer implements OFDeserializer<Mult
             long bandKey = 0;
 
             while (actualLength < itemLength) {
-                final byte[] packetCountB = new byte[EncodeConstants.SIZE_OF_LONG_IN_BYTES];
+                final byte[] packetCountB = new byte[Long.BYTES];
                 message.readBytes(packetCountB);
-                final byte[] byteCountB = new byte[EncodeConstants.SIZE_OF_LONG_IN_BYTES];
+                final byte[] byteCountB = new byte[Long.BYTES];
                 message.readBytes(byteCountB);
 
                 subItems.add(new BandStatBuilder()
@@ -96,5 +93,4 @@ public class MultipartReplyMeterStatsDeserializer implements OFDeserializer<Mult
             .setMeterStats(items)
             .build();
     }
-
 }
index 704a531b6af4456775212e86358e967bc5bfac34..320b833fff60336ccee22fef6c51c84b48b179da 100644 (file)
@@ -45,29 +45,29 @@ public class MultipartReplyPortStatsDeserializer implements OFDeserializer<Multi
 
             message.skipBytes(PADDING_IN_PORT_STATS_HEADER);
 
-            final byte[] recPack = new byte[EncodeConstants.SIZE_OF_LONG_IN_BYTES];
+            final byte[] recPack = new byte[Long.BYTES];
             message.readBytes(recPack);
-            final byte[] txPack = new byte[EncodeConstants.SIZE_OF_LONG_IN_BYTES];
+            final byte[] txPack = new byte[Long.BYTES];
             message.readBytes(txPack);
-            final byte[] recByt = new byte[EncodeConstants.SIZE_OF_LONG_IN_BYTES];
+            final byte[] recByt = new byte[Long.BYTES];
             message.readBytes(recByt);
-            final byte[] txByt = new byte[EncodeConstants.SIZE_OF_LONG_IN_BYTES];
+            final byte[] txByt = new byte[Long.BYTES];
             message.readBytes(txByt);
-            final byte[] recDrop = new byte[EncodeConstants.SIZE_OF_LONG_IN_BYTES];
+            final byte[] recDrop = new byte[Long.BYTES];
             message.readBytes(recDrop);
-            final byte[] txDrop = new byte[EncodeConstants.SIZE_OF_LONG_IN_BYTES];
+            final byte[] txDrop = new byte[Long.BYTES];
             message.readBytes(txDrop);
-            final byte[] recError = new byte[EncodeConstants.SIZE_OF_LONG_IN_BYTES];
+            final byte[] recError = new byte[Long.BYTES];
             message.readBytes(recError);
-            final byte[] txError = new byte[EncodeConstants.SIZE_OF_LONG_IN_BYTES];
+            final byte[] txError = new byte[Long.BYTES];
             message.readBytes(txError);
-            final byte[] recFrameError = new byte[EncodeConstants.SIZE_OF_LONG_IN_BYTES];
+            final byte[] recFrameError = new byte[Long.BYTES];
             message.readBytes(recFrameError);
-            final byte[] recOverRunError = new byte[EncodeConstants.SIZE_OF_LONG_IN_BYTES];
+            final byte[] recOverRunError = new byte[Long.BYTES];
             message.readBytes(recOverRunError);
-            final byte[] recCrcError = new byte[EncodeConstants.SIZE_OF_LONG_IN_BYTES];
+            final byte[] recCrcError = new byte[Long.BYTES];
             message.readBytes(recCrcError);
-            final byte[] collisionCount = new byte[EncodeConstants.SIZE_OF_LONG_IN_BYTES];
+            final byte[] collisionCount = new byte[Long.BYTES];
             message.readBytes(collisionCount);
 
             items.add(itemBuilder
index 4bd75a06149994e890f6a01b8b402571bbece274..6459ecf58f66f656238429fc56a0691162767218 100644 (file)
@@ -39,11 +39,11 @@ public class MultipartReplyQueueStatsDeserializer implements OFDeserializer<Mult
                     .getProtocolAgnosticPortUri(EncodeConstants.OF13_VERSION_ID, port));
             final QueueId queueId = new QueueId(message.readUnsignedInt());
 
-            final byte[] txBytes = new byte[EncodeConstants.SIZE_OF_LONG_IN_BYTES];
+            final byte[] txBytes = new byte[Long.BYTES];
             message.readBytes(txBytes);
-            final byte[] txPackets = new byte[EncodeConstants.SIZE_OF_LONG_IN_BYTES];
+            final byte[] txPackets = new byte[Long.BYTES];
             message.readBytes(txPackets);
-            final byte[] txErrors = new byte[EncodeConstants.SIZE_OF_LONG_IN_BYTES];
+            final byte[] txErrors = new byte[Long.BYTES];
             message.readBytes(txErrors);
 
             items.add(new QueueIdAndStatisticsMapBuilder()
index 8fff86361168d0f7ce16d5a9df994953c8d02bef..b5b95f21743a603ca36f21968968320f2b535202 100644 (file)
@@ -285,7 +285,7 @@ public class MultipartReplyTableFeaturesDeserializer implements OFDeserializer<M
                     .deserialize(message)
                     .map(matchFields::add)
                     .orElseGet(() -> {
-                        message.skipBytes(2 * EncodeConstants.SIZE_OF_SHORT_IN_BYTES);
+                        message.skipBytes(2 * Short.BYTES);
                         return Boolean.FALSE;
                     });
         }
@@ -324,7 +324,7 @@ public class MultipartReplyTableFeaturesDeserializer implements OFDeserializer<M
 
                 offset++;
             } catch (ClassCastException | IllegalStateException e) {
-                message.skipBytes(2 * EncodeConstants.SIZE_OF_SHORT_IN_BYTES);
+                message.skipBytes(2 * Short.BYTES);
             }
         }
 
@@ -348,7 +348,7 @@ public class MultipartReplyTableFeaturesDeserializer implements OFDeserializer<M
 
                 offset++;
             } catch (ClassCastException | IllegalStateException e) {
-                message.skipBytes(2 * EncodeConstants.SIZE_OF_SHORT_IN_BYTES);
+                message.skipBytes(2 * Short.BYTES);
             }
         }
 
index a6222e42d6cce3720df4cb6bb25e56e36c8afaee..47804c93b8bc8e20b03922eacf7b101b3f25f6b1 100644 (file)
@@ -237,9 +237,9 @@ public class TableFeaturesMatchFieldDeserializer {
      * @return SetFieldMatchBuilder with hasMask properly set
      */
     protected static SetFieldMatchBuilder processHeader(final ByteBuf in) {
-        in.skipBytes(EncodeConstants.SIZE_OF_SHORT_IN_BYTES); // skip oxm_class
+        in.skipBytes(Short.BYTES); // skip oxm_class
         boolean hasMask = (in.readUnsignedByte() & 1) != 0;
-        in.skipBytes(EncodeConstants.SIZE_OF_BYTE_IN_BYTES); // skip match entry length
+        in.skipBytes(Byte.BYTES); // skip match entry length
 
         return new SetFieldMatchBuilder()
                 .setHasMask(hasMask);
@@ -253,12 +253,11 @@ public class TableFeaturesMatchFieldDeserializer {
      */
     public Optional<SetFieldMatch> deserialize(final ByteBuf message) {
         int oxmClass = message.getUnsignedShort(message.readerIndex());
-        int oxmField = message.getUnsignedByte(message.readerIndex() + EncodeConstants.SIZE_OF_SHORT_IN_BYTES) >>> 1;
+        int oxmField = message.getUnsignedByte(message.readerIndex() + Short.BYTES) >>> 1;
         Uint32 expId = null;
 
         if (oxmClass == EncodeConstants.EXPERIMENTER_VALUE) {
-            expId = Uint32.valueOf(message.getUnsignedInt(message.readerIndex() + EncodeConstants.SIZE_OF_SHORT_IN_BYTES
-                    + 2 * EncodeConstants.SIZE_OF_BYTE_IN_BYTES));
+            expId = Uint32.valueOf(message.getUnsignedInt(message.readerIndex() + Short.BYTES + 2 * Byte.BYTES));
         }
 
         final MatchEntryDeserializerKey key =
index 85156baafc700f35ac61e9ee926fd73b80618d10..9ef95ce1bfebb1179f677daa82e0362d3a4f10af 100644 (file)
@@ -44,8 +44,7 @@ public final class ActionUtil {
         final Long expId;
 
         if (type == EncodeConstants.EXPERIMENTER_VALUE) {
-            expId = message.getUnsignedInt(message.readerIndex()
-                    + 2 * EncodeConstants.SIZE_OF_SHORT_IN_BYTES);
+            expId = message.getUnsignedInt(message.readerIndex() + 2 * Short.BYTES);
         } else {
             expId = null;
         }
@@ -83,8 +82,7 @@ public final class ActionUtil {
         final Long expId;
 
         if (type == EncodeConstants.EXPERIMENTER_VALUE) {
-            expId = message.getUnsignedInt(message.readerIndex()
-                    + 2 * EncodeConstants.SIZE_OF_SHORT_IN_BYTES);
+            expId = message.getUnsignedInt(message.readerIndex() + 2 * Short.BYTES);
         } else {
             expId = null;
         }
index 0f5cc192fc2125b7ade44fded4343ef7ecf81251..297535c9cce54a235f433c6495be7c3a292c4a48 100644 (file)
@@ -57,7 +57,7 @@ public final class InstructionUtil {
             Long expId = null;
 
             if (EncodeConstants.EXPERIMENTER_VALUE == type) {
-                expId = message.getUnsignedInt(message.readerIndex() + 2 * EncodeConstants.SIZE_OF_SHORT_IN_BYTES);
+                expId = message.getUnsignedInt(message.readerIndex() + 2 * Short.BYTES);
             }
 
             deserializer = registry.getDeserializer(
@@ -98,7 +98,7 @@ public final class InstructionUtil {
             Long expId = null;
 
             if (EncodeConstants.EXPERIMENTER_VALUE == type) {
-                expId = message.getUnsignedInt(message.readerIndex() + 2 * EncodeConstants.SIZE_OF_SHORT_IN_BYTES);
+                expId = message.getUnsignedInt(message.readerIndex() + 2 * Short.BYTES);
             }
 
             deserializer = registry.getDeserializer(
index 7556f194f5a2ff8dfc8dbbc9c11a4d2584b1a7b0..7a0bdfc22c0faee88bf280bc11c09169610ae538 100644 (file)
@@ -10,7 +10,6 @@ package org.opendaylight.openflowplugin.impl.protocol.serialization.match;
 import io.netty.buffer.ByteBuf;
 import org.eclipse.jdt.annotation.NonNull;
 import org.eclipse.jdt.annotation.Nullable;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 
 public abstract class AbstractExperimenterMatchEntrySerializer<E, M> extends AbstractMatchEntrySerializer<E, M> {
@@ -25,7 +24,7 @@ public abstract class AbstractExperimenterMatchEntrySerializer<E, M> extends Abs
     protected AbstractExperimenterMatchEntrySerializer(final int oxmFieldCode, final int valueLength,
             final long experimenterId) {
         this(new ConstantHeaderWriter<>(OxmMatchConstants.EXPERIMENTER_CLASS, oxmFieldCode, valueLength,
-                EncodeConstants.SIZE_OF_INT_IN_BYTES), experimenterId);
+                Integer.BYTES), experimenterId);
     }
 
     @Override
index 0bef52e5d95da2e1f9d913aebc444906292d5aff..6cd6eda1021b8221aea38a0552419a18ceca81b9 100644 (file)
@@ -9,7 +9,6 @@ package org.opendaylight.openflowplugin.impl.protocol.serialization.match;
 
 import io.netty.buffer.ByteBuf;
 import org.eclipse.jdt.annotation.NonNull;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.common.IpConversionUtil;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Address;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Prefix;
@@ -19,10 +18,9 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026
 
 abstract class AbstractIpv4PolymorphicEntrySerializer
         extends AbstractPolymorphicEntrySerializer<Ipv4MatchArbitraryBitMask, Ipv4Match, Ipv4Prefix, DottedQuad> {
-
     AbstractIpv4PolymorphicEntrySerializer(final int oxmClassCode, final int oxmFieldCode) {
-        super(oxmClassCode, oxmFieldCode, EncodeConstants.SIZE_OF_INT_IN_BYTES, Ipv4MatchArbitraryBitMask.class,
-            Ipv4Match.class, Ipv4Prefix.class, DottedQuad.class);
+        super(oxmClassCode, oxmFieldCode, Integer.BYTES, Ipv4MatchArbitraryBitMask.class, Ipv4Match.class,
+            Ipv4Prefix.class, DottedQuad.class);
     }
 
     @Override
@@ -40,8 +38,7 @@ abstract class AbstractIpv4PolymorphicEntrySerializer
             final ByteBuf outBuffer) {
         writeIpv4Address(extractArbitraryEntryAddress(arbitraryMatch), outBuffer);
         if (mask != null) {
-            writeMask(IpConversionUtil.convertArbitraryMaskToByteArray(mask), outBuffer,
-                EncodeConstants.SIZE_OF_INT_IN_BYTES);
+            writeMask(IpConversionUtil.convertArbitraryMaskToByteArray(mask), outBuffer, Integer.BYTES);
         }
     }
 
index 049015299d38d520cd782eb3175d5263f1a40f6a..80fb1593b3f1723c4eb42933b6d192231df1744f 100644 (file)
@@ -8,13 +8,12 @@
 package org.opendaylight.openflowplugin.impl.protocol.serialization.match;
 
 import io.netty.buffer.ByteBuf;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.common.IpConversionUtil;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Prefix;
 
 public abstract class AbstractIpv4PrefixEntrySerializer extends AbstractMatchEntrySerializer<Ipv4Prefix, Integer> {
     protected AbstractIpv4PrefixEntrySerializer(final int oxmClassCode, final int oxmFieldCode) {
-        super(new ConstantHeaderWriter<>(oxmClassCode, oxmFieldCode, EncodeConstants.SIZE_OF_INT_IN_BYTES));
+        super(new ConstantHeaderWriter<>(oxmClassCode, oxmFieldCode, Integer.BYTES));
     }
 
     @Override
index 0daf1643815bb005abe1ee791555181d96554404..16fd622e01aff614977d3297b82ce344a0c210db 100644 (file)
@@ -8,12 +8,11 @@
 package org.opendaylight.openflowplugin.impl.protocol.serialization.match;
 
 import io.netty.buffer.ByteBuf;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.yangtools.yang.common.Uint16;
 
 public abstract class AbstractUint16EntrySerializer extends AbstractPrimitiveEntrySerializer<Uint16> {
     protected AbstractUint16EntrySerializer(final int oxmClassCode, final int oxmFieldCode) {
-        super(oxmClassCode, oxmFieldCode, EncodeConstants.SIZE_OF_SHORT_IN_BYTES);
+        super(oxmClassCode, oxmFieldCode, Short.BYTES);
     }
 
     @Override
index 8aa55475160ac7caa5d845f0a78b0e43deb06322..f04cd2d7a22b940da9ff0782b4c9477f93a09c7d 100644 (file)
@@ -8,12 +8,11 @@
 package org.opendaylight.openflowplugin.impl.protocol.serialization.match;
 
 import io.netty.buffer.ByteBuf;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.yangtools.yang.common.Uint32;
 
 public abstract class AbstractUint32EntrySerializer extends AbstractPrimitiveEntrySerializer<Uint32> {
     protected AbstractUint32EntrySerializer(final int oxmClassCode, final int oxmFieldCode) {
-        super(oxmClassCode, oxmFieldCode, EncodeConstants.SIZE_OF_INT_IN_BYTES);
+        super(oxmClassCode, oxmFieldCode, Integer.BYTES);
     }
 
     @Override
index 8cf002f77bec400fd3a5c45848e43254ad2151e9..4bd446dc0f6d1f28a95e5e278ba74456edaf415f 100644 (file)
@@ -8,12 +8,11 @@
 package org.opendaylight.openflowplugin.impl.protocol.serialization.match;
 
 import io.netty.buffer.ByteBuf;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.yangtools.yang.common.Uint8;
 
 public abstract class AbstractUint8EntrySerializer extends AbstractPrimitiveEntrySerializer<Uint8> {
     protected AbstractUint8EntrySerializer(final int oxmClassCode, final int oxmFieldCode) {
-        super(oxmClassCode, oxmFieldCode, EncodeConstants.SIZE_OF_BYTE_IN_BYTES);
+        super(oxmClassCode, oxmFieldCode, Byte.BYTES);
     }
 
     @Override
index 621748440ac556ea34e2c87d650ec22772e6b6e7..db755bb0cebf5698e201bab6261de8feeba8b694 100644 (file)
@@ -5,11 +5,9 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.impl.protocol.serialization.match;
 
 import io.netty.buffer.ByteBuf;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.Match;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.ethernet.match.fields.EthernetType;
@@ -17,8 +15,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026
 
 public class EthernetTypeEntrySerializer extends AbstractPrimitiveEntrySerializer<EthernetType> {
     public EthernetTypeEntrySerializer() {
-        super(OxmMatchConstants.OPENFLOW_BASIC_CLASS, OxmMatchConstants.ETH_TYPE,
-            EncodeConstants.SIZE_OF_SHORT_IN_BYTES);
+        super(OxmMatchConstants.OPENFLOW_BASIC_CLASS, OxmMatchConstants.ETH_TYPE, Short.BYTES);
     }
 
     @Override
index 90f8b9d09f3148a861d026709ae4bca2b004faa2..b17cf327e9f6ba2bb1463f13c8c2e95f28d5cc19 100644 (file)
@@ -8,7 +8,6 @@
 package org.opendaylight.openflowplugin.impl.protocol.serialization.match;
 
 import io.netty.buffer.ByteBuf;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 import org.opendaylight.openflowplugin.api.openflow.md.util.OpenflowVersion;
 import org.opendaylight.openflowplugin.openflow.md.util.InventoryDataServiceUtil;
@@ -17,8 +16,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026
 
 public class InPhyPortEntrySerializer extends AbstractPrimitiveEntrySerializer<NodeConnectorId> {
     public InPhyPortEntrySerializer() {
-        super(OxmMatchConstants.OPENFLOW_BASIC_CLASS, OxmMatchConstants.IN_PHY_PORT,
-            EncodeConstants.SIZE_OF_INT_IN_BYTES);
+        super(OxmMatchConstants.OPENFLOW_BASIC_CLASS, OxmMatchConstants.IN_PHY_PORT, Integer.BYTES);
     }
 
     @Override
index eb962010c9b4c559046152a90dcb118926fdc909..13828fc4658217b34f269d1d0932fa5de20297c3 100644 (file)
@@ -8,7 +8,6 @@
 package org.opendaylight.openflowplugin.impl.protocol.serialization.match;
 
 import io.netty.buffer.ByteBuf;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 import org.opendaylight.openflowplugin.api.openflow.md.util.OpenflowVersion;
 import org.opendaylight.openflowplugin.openflow.md.util.InventoryDataServiceUtil;
@@ -18,7 +17,7 @@ import org.opendaylight.yangtools.yang.common.Uint32;
 
 public class InPortEntrySerializer extends AbstractPrimitiveEntrySerializer<NodeConnectorId> {
     public InPortEntrySerializer() {
-        super(OxmMatchConstants.OPENFLOW_BASIC_CLASS, OxmMatchConstants.IN_PORT,EncodeConstants.SIZE_OF_INT_IN_BYTES);
+        super(OxmMatchConstants.OPENFLOW_BASIC_CLASS, OxmMatchConstants.IN_PORT, Integer.BYTES);
     }
 
     @Override
index 9581db25c7c2a600344f3d18b6b42734bcfae210..e832b973d436149a8d82ef12c0f4da853c7ae94a 100644 (file)
@@ -8,7 +8,6 @@
 package org.opendaylight.openflowplugin.impl.protocol.serialization.match;
 
 import io.netty.buffer.ByteBuf;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Dscp;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.Match;
@@ -16,7 +15,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026
 
 public class IpDscpEntrySerializer extends AbstractPrimitiveEntrySerializer<Dscp> {
     public IpDscpEntrySerializer() {
-        super(OxmMatchConstants.OPENFLOW_BASIC_CLASS, OxmMatchConstants.IP_DSCP, EncodeConstants.SIZE_OF_BYTE_IN_BYTES);
+        super(OxmMatchConstants.OPENFLOW_BASIC_CLASS, OxmMatchConstants.IP_DSCP, Byte.BYTES);
     }
 
     @Override
index a789b7fda050238d1c2ea86e2167f1a907487e95..0036b20576cf89f4731d3a65576a6004797f83fe 100644 (file)
@@ -8,7 +8,6 @@
 package org.opendaylight.openflowplugin.impl.protocol.serialization.match;
 
 import io.netty.buffer.ByteBuf;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 import org.opendaylight.openflowplugin.openflow.md.util.ByteUtil;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.Match;
@@ -19,8 +18,7 @@ import org.opendaylight.yangtools.yang.common.Uint16;
 
 public class Ipv6ExtHeaderEntrySerializer extends AbstractMatchEntrySerializer<Ipv6ExtHeader, Uint16> {
     public Ipv6ExtHeaderEntrySerializer() {
-        super(OxmMatchConstants.OPENFLOW_BASIC_CLASS, OxmMatchConstants.IPV6_EXTHDR,
-            EncodeConstants.SIZE_OF_SHORT_IN_BYTES);
+        super(OxmMatchConstants.OPENFLOW_BASIC_CLASS, OxmMatchConstants.IPV6_EXTHDR, Short.BYTES);
     }
 
     @Override
@@ -38,7 +36,7 @@ public class Ipv6ExtHeaderEntrySerializer extends AbstractMatchEntrySerializer<I
     protected void serializeEntry(final Ipv6ExtHeader entry, final Uint16 mask, final ByteBuf outBuffer) {
         outBuffer.writeShort(entry.getIpv6Exthdr().shortValue());
         if (mask != null) {
-            writeMask(ByteUtil.unsignedShortToBytes(mask), outBuffer, EncodeConstants.SIZE_OF_SHORT_IN_BYTES);
+            writeMask(ByteUtil.unsignedShortToBytes(mask), outBuffer, Short.BYTES);
         }
     }
 }
index b8a1fd9a172e062ae520fd75a5708372189ed432..e84b9710a91dbf20ce61679e54c418046ced6145 100644 (file)
@@ -8,7 +8,6 @@
 package org.opendaylight.openflowplugin.impl.protocol.serialization.match;
 
 import io.netty.buffer.ByteBuf;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 import org.opendaylight.openflowplugin.openflow.md.util.ByteUtil;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv6FlowLabel;
@@ -19,8 +18,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026
 
 public class Ipv6LabelEntrySerializer extends AbstractMatchEntrySerializer<Ipv6Label, Ipv6FlowLabel> {
     public Ipv6LabelEntrySerializer() {
-        super(OxmMatchConstants.OPENFLOW_BASIC_CLASS, OxmMatchConstants.IPV6_FLABEL,
-            EncodeConstants.SIZE_OF_INT_IN_BYTES);
+        super(OxmMatchConstants.OPENFLOW_BASIC_CLASS, OxmMatchConstants.IPV6_FLABEL, Integer.BYTES);
     }
 
     @Override
@@ -38,7 +36,7 @@ public class Ipv6LabelEntrySerializer extends AbstractMatchEntrySerializer<Ipv6L
     protected void serializeEntry(final Ipv6Label entry, final Ipv6FlowLabel mask, final ByteBuf outBuffer) {
         outBuffer.writeInt(entry.getIpv6Flabel().getValue().intValue());
         if (mask != null) {
-            writeMask(ByteUtil.unsignedIntToBytes(mask.getValue()), outBuffer, EncodeConstants.SIZE_OF_INT_IN_BYTES);
+            writeMask(ByteUtil.unsignedIntToBytes(mask.getValue()), outBuffer, Integer.BYTES);
         }
     }
 }
index 87fc469a0482b92d681d60ee429d26f4223cb8bb..4fafaa5173a924e9600adc037c9b4abdb37510d6 100644 (file)
@@ -8,7 +8,6 @@
 package org.opendaylight.openflowplugin.impl.protocol.serialization.match;
 
 import io.netty.buffer.ByteBuf;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 import org.opendaylight.openflowplugin.openflow.md.util.ByteUtil;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.Match;
@@ -17,8 +16,7 @@ import org.opendaylight.yangtools.yang.common.Uint64;
 
 public class MetadataEntrySerializer extends AbstractMatchEntrySerializer<Metadata, Uint64> {
     public MetadataEntrySerializer() {
-        super(OxmMatchConstants.OPENFLOW_BASIC_CLASS, OxmMatchConstants.METADATA,
-            EncodeConstants.SIZE_OF_LONG_IN_BYTES);
+        super(OxmMatchConstants.OPENFLOW_BASIC_CLASS, OxmMatchConstants.METADATA, Long.BYTES);
     }
 
     @Override
@@ -35,7 +33,7 @@ public class MetadataEntrySerializer extends AbstractMatchEntrySerializer<Metada
     protected void serializeEntry(Metadata entry, Uint64 mask, ByteBuf outBuffer) {
         outBuffer.writeBytes(ByteUtil.uint64toBytes(entry.getMetadata()));
         if (mask != null) {
-            writeMask(ByteUtil.uint64toBytes(mask), outBuffer, EncodeConstants.SIZE_OF_LONG_IN_BYTES);
+            writeMask(ByteUtil.uint64toBytes(mask), outBuffer, Long.BYTES);
         }
     }
 }
index 45192ae4c44c9965b70d0f788bd2257796a85d60..f255df380f2aae8c725776f525bb288824fead4f 100644 (file)
@@ -8,7 +8,6 @@
 package org.opendaylight.openflowplugin.impl.protocol.serialization.match;
 
 import io.netty.buffer.ByteBuf;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.Match;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.ProtocolMatchFields;
@@ -16,8 +15,7 @@ import org.opendaylight.yangtools.yang.common.Uint8;
 
 public class MplsBosEntrySerializer extends AbstractPrimitiveEntrySerializer<Uint8> {
     public MplsBosEntrySerializer() {
-        super(OxmMatchConstants.OPENFLOW_BASIC_CLASS, OxmMatchConstants.MPLS_BOS,
-            EncodeConstants.SIZE_OF_BYTE_IN_BYTES);
+        super(OxmMatchConstants.OPENFLOW_BASIC_CLASS, OxmMatchConstants.MPLS_BOS, Byte.BYTES);
     }
 
     @Override
index 74e7d9dde6d86eb106fc74afb66fc928c1d39044..02ebd25521858a31c131a8958bd2f5c6ef7ab7a5 100644 (file)
@@ -16,8 +16,7 @@ import org.opendaylight.yangtools.yang.common.Uint16;
 
 public class TcpFlagsEntrySerializer extends AbstractExperimenterMatchEntrySerializer<TcpFlagsMatch, Uint16> {
     public TcpFlagsEntrySerializer() {
-        super(EncodeConstants.ONFOXM_ET_TCP_FLAGS, EncodeConstants.SIZE_OF_SHORT_IN_BYTES,
-            EncodeConstants.ONF_EXPERIMENTER_ID.toJava());
+        super(EncodeConstants.ONFOXM_ET_TCP_FLAGS, Short.BYTES, EncodeConstants.ONF_EXPERIMENTER_ID.toJava());
     }
 
     @Override
@@ -35,7 +34,7 @@ public class TcpFlagsEntrySerializer extends AbstractExperimenterMatchEntrySeria
     protected void serializeEntryContent(TcpFlagsMatch entry, Uint16 mask, ByteBuf outBuffer) {
         outBuffer.writeShort(entry.getTcpFlags().shortValue());
         if (mask != null) {
-            writeMask(ByteUtil.unsignedShortToBytes(mask), outBuffer, EncodeConstants.SIZE_OF_SHORT_IN_BYTES);
+            writeMask(ByteUtil.unsignedShortToBytes(mask), outBuffer, Short.BYTES);
         }
     }
 }
index 7eda87076838f8b07bf3b9e693725322514875fe..ba57108eb1521b7d12648bf4902683be1b362232 100644 (file)
@@ -8,7 +8,6 @@
 package org.opendaylight.openflowplugin.impl.protocol.serialization.match;
 
 import io.netty.buffer.ByteBuf;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 import org.opendaylight.openflowplugin.openflow.md.util.ByteUtil;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.Match;
@@ -17,8 +16,7 @@ import org.opendaylight.yangtools.yang.common.Uint64;
 
 public class TunnelIdEntrySerializer extends AbstractMatchEntrySerializer<Tunnel, Uint64> {
     public TunnelIdEntrySerializer() {
-        super(OxmMatchConstants.OPENFLOW_BASIC_CLASS, OxmMatchConstants.TUNNEL_ID,
-            EncodeConstants.SIZE_OF_LONG_IN_BYTES);
+        super(OxmMatchConstants.OPENFLOW_BASIC_CLASS, OxmMatchConstants.TUNNEL_ID, Long.BYTES);
     }
 
     @Override
@@ -36,7 +34,7 @@ public class TunnelIdEntrySerializer extends AbstractMatchEntrySerializer<Tunnel
     protected void serializeEntry(Tunnel entry, Uint64 mask, ByteBuf outBuffer) {
         outBuffer.writeBytes(ByteUtil.uint64toBytes(entry.getTunnelId()));
         if (mask != null) {
-            writeMask(ByteUtil.uint64toBytes(mask), outBuffer, EncodeConstants.SIZE_OF_LONG_IN_BYTES);
+            writeMask(ByteUtil.uint64toBytes(mask), outBuffer, Long.BYTES);
         }
     }
 }
index 1b30ab3211de3a829fbafb77ed5c40cdbd7f4d29..423b08bf974b9c3146a57911fbede2f1a5bc88b1 100644 (file)
@@ -8,7 +8,6 @@
 package org.opendaylight.openflowplugin.impl.protocol.serialization.match;
 
 import io.netty.buffer.ByteBuf;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.l2.types.rev130827.VlanPcp;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.Match;
@@ -16,8 +15,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026
 
 public class VlanPcpEntrySerializer extends AbstractPrimitiveEntrySerializer<VlanPcp> {
     public VlanPcpEntrySerializer() {
-        super(OxmMatchConstants.OPENFLOW_BASIC_CLASS, OxmMatchConstants.VLAN_PCP,
-            EncodeConstants.SIZE_OF_BYTE_IN_BYTES);
+        super(OxmMatchConstants.OPENFLOW_BASIC_CLASS, OxmMatchConstants.VLAN_PCP, Byte.BYTES);
     }
 
     @Override
index 8be40e504a5ce258e3bb99cfb8066d265f57d6ed..ed2f8df64e76bec7e82c1fee843695b63e0ae85d 100644 (file)
@@ -8,7 +8,6 @@
 package org.opendaylight.openflowplugin.impl.protocol.serialization.match;
 
 import io.netty.buffer.ByteBuf;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.Match;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.VlanMatch;
@@ -19,8 +18,7 @@ public class VlanVidEntrySerializer extends AbstractMatchEntrySerializer<VlanId,
     private static final byte[] VLAN_VID_MASK = new byte[]{16, 0};
 
     public VlanVidEntrySerializer() {
-        super(OxmMatchConstants.OPENFLOW_BASIC_CLASS, OxmMatchConstants.VLAN_VID,
-            EncodeConstants.SIZE_OF_SHORT_IN_BYTES);
+        super(OxmMatchConstants.OPENFLOW_BASIC_CLASS, OxmMatchConstants.VLAN_VID, Short.BYTES);
     }
 
     @Override
@@ -49,7 +47,7 @@ public class VlanVidEntrySerializer extends AbstractMatchEntrySerializer<VlanId,
         outBuffer.writeShort(vlanVidValue);
 
         if (mask != null) {
-            writeMask(VLAN_VID_MASK, outBuffer, EncodeConstants.SIZE_OF_SHORT_IN_BYTES);
+            writeMask(VLAN_VID_MASK, outBuffer, Short.BYTES);
         }
     }
 }
index 31004bb0df5d74432c11a226b498c63aaf3f790e..4d58744af3c733847d93192b51625acf37263cce 100644 (file)
@@ -5,10 +5,8 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.matchfield;
 
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 
 public class ArpOpMatchFieldSerializer extends AbstractMatchFieldSerializer {
@@ -24,6 +22,6 @@ public class ArpOpMatchFieldSerializer extends AbstractMatchFieldSerializer {
 
     @Override
     protected int getValueLength() {
-        return EncodeConstants.SIZE_OF_SHORT_IN_BYTES;
+        return Short.BYTES;
     }
 }
index 305f4b813c957c00696820a03c93d1fcea4cbac7..edbf92965d7480a9c8f58ee4ee2206fcb99a0dab 100644 (file)
@@ -5,10 +5,8 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.matchfield;
 
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 
 public class ArpSpaMatchFieldSerializer extends AbstractMatchFieldSerializer {
@@ -24,6 +22,6 @@ public class ArpSpaMatchFieldSerializer extends AbstractMatchFieldSerializer {
 
     @Override
     protected int getValueLength() {
-        return EncodeConstants.SIZE_OF_INT_IN_BYTES;
+        return Integer.BYTES;
     }
 }
index d3ac917bd23f8d7ca99e6b83f4f8a4eb17daa376..101755a4e5743f744b395b4e9d7bb7cf39e1288c 100644 (file)
@@ -5,10 +5,8 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.matchfield;
 
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 
 public class ArpTpaMatchFieldSerializer extends AbstractMatchFieldSerializer {
@@ -24,6 +22,6 @@ public class ArpTpaMatchFieldSerializer extends AbstractMatchFieldSerializer {
 
     @Override
     protected int getValueLength() {
-        return EncodeConstants.SIZE_OF_INT_IN_BYTES;
+        return Integer.BYTES;
     }
 }
index 8c18274355687cd474d80bc9307bd0799634ac29..ad92aabe375e47e4a8785ddfcb965530b06c4872 100644 (file)
@@ -5,10 +5,8 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.matchfield;
 
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 
 public class EthTypeMatchFieldSerializer extends AbstractMatchFieldSerializer {
@@ -24,6 +22,6 @@ public class EthTypeMatchFieldSerializer extends AbstractMatchFieldSerializer {
 
     @Override
     protected int getValueLength() {
-        return EncodeConstants.SIZE_OF_SHORT_IN_BYTES;
+        return Short.BYTES;
     }
 }
index 6d7b19dc1dc01eb4cdb1e2835bc6e673d82f53ad..4f37d3e9502987e7efad055431488b30e32ccc89 100644 (file)
@@ -5,10 +5,8 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.matchfield;
 
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 
 public class Icmpv4CodeMatchFieldSerializer extends AbstractMatchFieldSerializer {
@@ -24,6 +22,6 @@ public class Icmpv4CodeMatchFieldSerializer extends AbstractMatchFieldSerializer
 
     @Override
     protected int getValueLength() {
-        return EncodeConstants.SIZE_OF_BYTE_IN_BYTES;
+        return Byte.BYTES;
     }
 }
index 7947f44101559431e493b4c055bdf25919382f02..d512b44d404a1981338dec254a7208f9df74d2d2 100644 (file)
@@ -5,10 +5,8 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.matchfield;
 
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 
 public class Icmpv4TypeMatchFieldSerializer extends AbstractMatchFieldSerializer {
@@ -24,6 +22,6 @@ public class Icmpv4TypeMatchFieldSerializer extends AbstractMatchFieldSerializer
 
     @Override
     protected int getValueLength() {
-        return EncodeConstants.SIZE_OF_BYTE_IN_BYTES;
+        return Byte.BYTES;
     }
 }
index d6b8a4bf462e4dfe8883aa3b1d20526bb017cedc..47afbfc609821fe884474a73df09343fed2830a7 100644 (file)
@@ -5,10 +5,8 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.matchfield;
 
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 
 public class Icmpv6CodeMatchFieldSerializer extends AbstractMatchFieldSerializer {
@@ -24,6 +22,6 @@ public class Icmpv6CodeMatchFieldSerializer extends AbstractMatchFieldSerializer
 
     @Override
     protected int getValueLength() {
-        return EncodeConstants.SIZE_OF_BYTE_IN_BYTES;
+        return Byte.BYTES;
     }
 }
index 53e092f70e761757b9b04cf7e53365783542893f..e918c08f63af0c7fc7e39626833691105a6a3adf 100644 (file)
@@ -5,10 +5,8 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.matchfield;
 
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 
 public class Icmpv6TypeMatchFieldSerializer extends AbstractMatchFieldSerializer {
@@ -24,6 +22,6 @@ public class Icmpv6TypeMatchFieldSerializer extends AbstractMatchFieldSerializer
 
     @Override
     protected int getValueLength() {
-        return EncodeConstants.SIZE_OF_BYTE_IN_BYTES;
+        return Byte.BYTES;
     }
 }
index 65355cf523ae6eafafd27d37996314d0cbe3a15e..19b275d8ec51c393cec93a7f21f15cd1c1e21c84 100644 (file)
@@ -5,10 +5,8 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.matchfield;
 
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 
 public class InPhyPortMatchFieldSerializer extends AbstractMatchFieldSerializer {
@@ -24,6 +22,6 @@ public class InPhyPortMatchFieldSerializer extends AbstractMatchFieldSerializer
 
     @Override
     protected int getValueLength() {
-        return EncodeConstants.SIZE_OF_INT_IN_BYTES;
+        return Integer.BYTES;
     }
 }
index 059be6d5b069d8f00415935d99790f9603a129d5..3c3a76eeccbb66686cd7239320e04b6e5c6dbed6 100644 (file)
@@ -5,10 +5,8 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.matchfield;
 
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 
 public class InPortMatchFieldSerializer extends AbstractMatchFieldSerializer {
@@ -24,6 +22,6 @@ public class InPortMatchFieldSerializer extends AbstractMatchFieldSerializer {
 
     @Override
     protected int getValueLength() {
-        return EncodeConstants.SIZE_OF_INT_IN_BYTES;
+        return Integer.BYTES;
     }
 }
index 203d027d1dc6060e0eb9bb9b26838c5845d42eae..7f1a5adb55641b1cecde895da569092d449dc5c8 100644 (file)
@@ -5,10 +5,8 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.matchfield;
 
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 
 public class IpDscpMatchFieldSerializer extends AbstractMatchFieldSerializer {
@@ -24,6 +22,6 @@ public class IpDscpMatchFieldSerializer extends AbstractMatchFieldSerializer {
 
     @Override
     protected int getValueLength() {
-        return EncodeConstants.SIZE_OF_BYTE_IN_BYTES;
+        return Byte.BYTES;
     }
 }
index 211a9fd666a1e3d4a137c5c1cc960eba16ffb7db..db741a7f616dae73057684423380d61b2a989019 100644 (file)
@@ -5,10 +5,8 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.matchfield;
 
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 
 public class IpEcnMatchFieldSerializer extends AbstractMatchFieldSerializer {
@@ -24,6 +22,6 @@ public class IpEcnMatchFieldSerializer extends AbstractMatchFieldSerializer {
 
     @Override
     protected int getValueLength() {
-        return EncodeConstants.SIZE_OF_BYTE_IN_BYTES;
+        return Byte.BYTES;
     }
 }
index b525109e2e687776df1332c89940a4006439d724..2b7ac01ac761652eff3bc219e7b4962b4869f712 100644 (file)
@@ -5,10 +5,8 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.matchfield;
 
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 
 public class IpProtoMatchFieldSerializer extends AbstractMatchFieldSerializer {
@@ -24,6 +22,6 @@ public class IpProtoMatchFieldSerializer extends AbstractMatchFieldSerializer {
 
     @Override
     protected int getValueLength() {
-        return EncodeConstants.SIZE_OF_BYTE_IN_BYTES;
+        return Byte.BYTES;
     }
 }
index 65bf2e897b79c048334d8c381e16521d8d25accb..5c75b88db3f6f649811a62864fe5756be76a48b1 100644 (file)
@@ -5,10 +5,8 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.matchfield;
 
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 
 public class Ipv4DstMatchFieldSerializer extends AbstractMatchFieldSerializer {
@@ -24,6 +22,6 @@ public class Ipv4DstMatchFieldSerializer extends AbstractMatchFieldSerializer {
 
     @Override
     protected int getValueLength() {
-        return EncodeConstants.SIZE_OF_INT_IN_BYTES;
+        return Integer.BYTES;
     }
 }
index 25dc1cefda62b4af10fe8d4ca7f2888fb1bff8d7..13cdb86b793b311260115f27cbc86f401ad206c3 100644 (file)
@@ -5,10 +5,8 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.matchfield;
 
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 
 public class Ipv4SrcMatchFieldSerializer extends AbstractMatchFieldSerializer {
@@ -24,6 +22,6 @@ public class Ipv4SrcMatchFieldSerializer extends AbstractMatchFieldSerializer {
 
     @Override
     protected int getValueLength() {
-        return EncodeConstants.SIZE_OF_INT_IN_BYTES;
+        return Integer.BYTES;
     }
 }
index aa1b50dc6a2e5d3c15412fd9982cf1ffa291afca..8488f596ff371e8d14cf8a16e1198f12a3b587ad 100644 (file)
@@ -5,10 +5,8 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.matchfield;
 
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 
 public class Ipv6ExtHdrMatchFieldSerializer extends AbstractMatchFieldSerializer {
@@ -24,6 +22,6 @@ public class Ipv6ExtHdrMatchFieldSerializer extends AbstractMatchFieldSerializer
 
     @Override
     protected int getValueLength() {
-        return EncodeConstants.SIZE_OF_SHORT_IN_BYTES;
+        return Short.BYTES;
     }
 }
index 20d813c4c00823451d34beead373d9bf8a50b81d..d69de0d9dbaa17326af04cf201afec1096b81b42 100644 (file)
@@ -5,10 +5,8 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.matchfield;
 
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 
 public class Ipv6FlabelMatchFieldSerializer extends AbstractMatchFieldSerializer {
@@ -24,6 +22,6 @@ public class Ipv6FlabelMatchFieldSerializer extends AbstractMatchFieldSerializer
 
     @Override
     protected int getValueLength() {
-        return EncodeConstants.SIZE_OF_INT_IN_BYTES;
+        return Integer.BYTES;
     }
 }
index 9cfacf9320b202de5f79658fc47d3c519d844f6b..570f3a3c8639654f9b691f0f9995a1e8ab016b54 100644 (file)
@@ -5,10 +5,8 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.matchfield;
 
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 
 public class MetadataMatchFieldSerializer extends AbstractMatchFieldSerializer {
@@ -24,6 +22,6 @@ public class MetadataMatchFieldSerializer extends AbstractMatchFieldSerializer {
 
     @Override
     protected int getValueLength() {
-        return EncodeConstants.SIZE_OF_LONG_IN_BYTES;
+        return Long.BYTES;
     }
 }
index 8d043f835012370930cb68001544d8571d30369c..4bd0829c7f294271190e3f234dc7c66236fedf6d 100644 (file)
@@ -5,10 +5,8 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.matchfield;
 
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 
 public class MplsBosMatchFieldSerializer extends AbstractMatchFieldSerializer {
@@ -24,6 +22,6 @@ public class MplsBosMatchFieldSerializer extends AbstractMatchFieldSerializer {
 
     @Override
     protected int getValueLength() {
-        return EncodeConstants.SIZE_OF_BYTE_IN_BYTES;
+        return Byte.BYTES;
     }
 }
index 01272508820b13ab74e12a82dd0b60096d9ddbc6..630a1035e601859fdc0ec80ed8a10c7ab85cff38 100644 (file)
@@ -5,10 +5,8 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.matchfield;
 
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 
 public class MplsLabelMatchFieldSerializer extends AbstractMatchFieldSerializer {
@@ -24,6 +22,6 @@ public class MplsLabelMatchFieldSerializer extends AbstractMatchFieldSerializer
 
     @Override
     protected int getValueLength() {
-        return EncodeConstants.SIZE_OF_INT_IN_BYTES;
+        return Integer.BYTES;
     }
 }
index 2b4b0243802e3693666156af7be49fe8ad836d98..510b765728147e8b0de11244f2b651d8463454b8 100644 (file)
@@ -5,10 +5,8 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.matchfield;
 
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 
 public class MplsTcMatchFieldSerializer extends AbstractMatchFieldSerializer {
@@ -24,6 +22,6 @@ public class MplsTcMatchFieldSerializer extends AbstractMatchFieldSerializer {
 
     @Override
     protected int getValueLength() {
-        return EncodeConstants.SIZE_OF_BYTE_IN_BYTES;
+        return Byte.BYTES;
     }
 }
index 3b9f3aa5b814b57732e08876fd8199fb0cd876a1..a20e79cc74779d18dfbdc8f74584a6cb93097b96 100644 (file)
@@ -5,10 +5,8 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.matchfield;
 
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 
 public class SctpDstMatchFieldSerializer extends AbstractMatchFieldSerializer {
@@ -24,6 +22,6 @@ public class SctpDstMatchFieldSerializer extends AbstractMatchFieldSerializer {
 
     @Override
     protected int getValueLength() {
-        return EncodeConstants.SIZE_OF_SHORT_IN_BYTES;
+        return Short.BYTES;
     }
 }
index b929f400134bae71eb13f1b3696794b45a980c8b..0fcc342f45167d6961b73456cb69750e5a2caa8c 100644 (file)
@@ -5,10 +5,8 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.matchfield;
 
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 
 public class SctpSrcMatchFieldSerializer extends AbstractMatchFieldSerializer {
@@ -24,6 +22,6 @@ public class SctpSrcMatchFieldSerializer extends AbstractMatchFieldSerializer {
 
     @Override
     protected int getValueLength() {
-        return EncodeConstants.SIZE_OF_SHORT_IN_BYTES;
+        return Short.BYTES;
     }
 }
index 585ef9d3f327499ff944b2ae6a049dc51403c105..50f854b40aef76d94671e104a897ecb45aa431e0 100644 (file)
@@ -5,10 +5,8 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.matchfield;
 
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 
 public class TcpDstMatchFieldSerializer extends AbstractMatchFieldSerializer {
@@ -24,6 +22,6 @@ public class TcpDstMatchFieldSerializer extends AbstractMatchFieldSerializer {
 
     @Override
     protected int getValueLength() {
-        return EncodeConstants.SIZE_OF_SHORT_IN_BYTES;
+        return Short.BYTES;
     }
 }
index b492eb36b26b2de2200fbe2bff8ca2ea7eb7ed78..e4f890411a3564ae2e29aafe9dbd6f502f836d05 100644 (file)
@@ -25,6 +25,6 @@ public class TcpFlagsMatchFieldSerializer extends AbstractMatchFieldSerializer {
     @Override
     protected int getValueLength() {
         // Increase length by experimenter ID length
-        return EncodeConstants.SIZE_OF_SHORT_IN_BYTES + EncodeConstants.SIZE_OF_INT_IN_BYTES;
+        return Short.BYTES + Integer.BYTES;
     }
 }
index f04a031d4e4c375fbf2698d04b9984aabf8b9d3b..2f5a89ef3869b831ed53d45a5d9b5391193d99e6 100644 (file)
@@ -5,10 +5,8 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.matchfield;
 
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 
 public class TcpSrcMatchFieldSerializer extends AbstractMatchFieldSerializer {
@@ -24,6 +22,6 @@ public class TcpSrcMatchFieldSerializer extends AbstractMatchFieldSerializer {
 
     @Override
     protected int getValueLength() {
-        return EncodeConstants.SIZE_OF_SHORT_IN_BYTES;
+        return Short.BYTES;
     }
 }
index 96edb9fad1a6864496bd3d27aae2ff077d50c74f..ea5199326c09548494bb538a04aeba8213f1ce34 100644 (file)
@@ -5,10 +5,8 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.matchfield;
 
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 
 public class TunnelIdMatchFieldSerializer extends AbstractMatchFieldSerializer {
@@ -24,6 +22,6 @@ public class TunnelIdMatchFieldSerializer extends AbstractMatchFieldSerializer {
 
     @Override
     protected int getValueLength() {
-        return EncodeConstants.SIZE_OF_LONG_IN_BYTES;
+        return Long.BYTES;
     }
 }
index 43e7fb32f1cbb434f0ae86c541af7a2d3dc2eb4a..ca2c04a9cc2395bbb9639143c5529ba048b9d62d 100644 (file)
@@ -5,10 +5,8 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.matchfield;
 
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 
 public class UdpDstMatchFieldSerializer extends AbstractMatchFieldSerializer {
@@ -24,6 +22,6 @@ public class UdpDstMatchFieldSerializer extends AbstractMatchFieldSerializer {
 
     @Override
     protected int getValueLength() {
-        return EncodeConstants.SIZE_OF_SHORT_IN_BYTES;
+        return Short.BYTES;
     }
 }
index 265cc567cb61beb490167147f8fbba5492a63a60..5d8a9497fb87b22f2e1724d3e9701dc38ae6b6f5 100644 (file)
@@ -5,10 +5,8 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.matchfield;
 
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 
 public class UdpSrcMatchFieldSerializer extends AbstractMatchFieldSerializer {
@@ -24,6 +22,6 @@ public class UdpSrcMatchFieldSerializer extends AbstractMatchFieldSerializer {
 
     @Override
     protected int getValueLength() {
-        return EncodeConstants.SIZE_OF_SHORT_IN_BYTES;
+        return Short.BYTES;
     }
 }
index 0aa22effc40755d91bdada18b346d3511e440fc8..434511d6e7bccdb45393e46c9f0e7ebbb29f74c8 100644 (file)
@@ -5,10 +5,8 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.matchfield;
 
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 
 public class VlanPcpMatchFieldSerializer extends AbstractMatchFieldSerializer {
@@ -24,6 +22,6 @@ public class VlanPcpMatchFieldSerializer extends AbstractMatchFieldSerializer {
 
     @Override
     protected int getValueLength() {
-        return EncodeConstants.SIZE_OF_BYTE_IN_BYTES;
+        return Byte.BYTES;
     }
 }
index 2f7f50e1cd4c3c22c93b01383efc723ee6479dcd..d631454794b3cf819922636b084aa8e7b7f3725b 100644 (file)
@@ -5,10 +5,8 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.matchfield;
 
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 
 public class VlanVidMatchFieldSerializer extends AbstractMatchFieldSerializer {
@@ -24,6 +22,6 @@ public class VlanVidMatchFieldSerializer extends AbstractMatchFieldSerializer {
 
     @Override
     protected int getValueLength() {
-        return EncodeConstants.SIZE_OF_SHORT_IN_BYTES;
+        return Short.BYTES;
     }
 }
index 424194b51fdd550b3b577b1046237a7bac85f508..84ccad31a4e0f3d52a14f1d146c5fea76a0fd72d 100644 (file)
@@ -31,9 +31,9 @@ public class SetFieldActionDeserializerTest extends AbstractActionDeserializerTe
         writeHeader(in);
         in.writeShort(OxmMatchConstants.OPENFLOW_BASIC_CLASS);
         in.writeByte(OxmMatchConstants.IN_PORT << 1);
-        in.writeByte(EncodeConstants.SIZE_OF_INT_IN_BYTES);
+        in.writeByte(Integer.BYTES);
         in.writeInt(portNum);
-        in.writeZero(EncodeConstants.SIZE_OF_INT_IN_BYTES);
+        in.writeZero(Integer.BYTES);
 
         final Action action = deserializeAction(in);
         assertTrue(action instanceof SetFieldCase);
index 5fc8dfd32373144b4f5f5ef5de267c558516c951..2d841c8e10461cb6b17413462da8ab501f352816 100644 (file)
@@ -5,7 +5,6 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.impl.protocol.deserialization.instruction;
 
 import static org.junit.Assert.assertArrayEquals;
@@ -15,14 +14,12 @@ import io.netty.buffer.ByteBuf;
 import io.netty.buffer.UnpooledByteBufAllocator;
 import java.math.BigInteger;
 import org.junit.Test;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.impl.util.InstructionConstants;
 import org.opendaylight.openflowplugin.openflow.md.util.ByteUtil;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.Instruction;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.instruction.WriteMetadataCase;
 
 public class WriteMetadataInstructionDeserializerTest extends AbstractInstructionDeserializerTest {
-
     @Test
     public void testDeserialize() {
         final ByteBuf in = UnpooledByteBufAllocator.DEFAULT.buffer();
@@ -30,18 +27,18 @@ public class WriteMetadataInstructionDeserializerTest extends AbstractInstructio
         final BigInteger metadataMask = BigInteger.valueOf(9876L);
         writeHeader(in);
         in.writeZero(InstructionConstants.PADDING_IN_WRITE_METADATA);
-        in.writeBytes(ByteUtil.convertBigIntegerToNBytes(metadata, EncodeConstants.SIZE_OF_LONG_IN_BYTES));
-        in.writeBytes(ByteUtil.convertBigIntegerToNBytes(metadataMask, EncodeConstants.SIZE_OF_LONG_IN_BYTES));
+        in.writeBytes(ByteUtil.convertBigIntegerToNBytes(metadata, Long.BYTES));
+        in.writeBytes(ByteUtil.convertBigIntegerToNBytes(metadataMask, Long.BYTES));
 
         final Instruction instruction = deserializeInstruction(in);
         assertEquals(WriteMetadataCase.class, instruction.implementedInterface());
 
         assertArrayEquals(
-                ByteUtil.convertBigIntegerToNBytes(metadata, EncodeConstants.SIZE_OF_LONG_IN_BYTES),
+                ByteUtil.convertBigIntegerToNBytes(metadata, Long.BYTES),
                 ByteUtil.uint64toBytes(((WriteMetadataCase) instruction).getWriteMetadata().getMetadata()));
 
         assertArrayEquals(
-                ByteUtil.convertBigIntegerToNBytes(metadataMask, EncodeConstants.SIZE_OF_LONG_IN_BYTES),
+                ByteUtil.convertBigIntegerToNBytes(metadataMask, Long.BYTES),
                 ByteUtil.uint64toBytes(((WriteMetadataCase) instruction).getWriteMetadata().getMetadataMask()));
 
         assertEquals(0, in.readableBytes());
@@ -56,5 +53,4 @@ public class WriteMetadataInstructionDeserializerTest extends AbstractInstructio
     protected short getLength() {
         return InstructionConstants.STANDARD_INSTRUCTION_LENGTH;
     }
-
 }
index c43d3731f2d3eef83ff07fe0aba0b1712577978d..a7d8800948d2fc86c08cf22916c1a345db7842c1 100644 (file)
@@ -5,7 +5,6 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.impl.protocol.deserialization.match;
 
 import static org.junit.Assert.assertEquals;
@@ -13,12 +12,10 @@ import static org.junit.Assert.assertEquals;
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.UnpooledByteBufAllocator;
 import org.junit.Test;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._3.match.ArpMatch;
 
 public class ArpOpEntryDeserializerTest extends AbstractMatchEntryDeserializerTest {
-
     @Test
     public void deserializeEntry() {
         final ByteBuf in = UnpooledByteBufAllocator.DEFAULT.buffer();
@@ -43,6 +40,6 @@ public class ArpOpEntryDeserializerTest extends AbstractMatchEntryDeserializerTe
 
     @Override
     protected int getValueLength() {
-        return EncodeConstants.SIZE_OF_SHORT_IN_BYTES;
+        return Short.BYTES;
     }
-}
\ No newline at end of file
+}
index a34a750f5317fb4a30b5e5ecd9c7e8236533e7bf..6cdbf47a7f2042ceb381aab2b966564bb1557627 100644 (file)
@@ -5,7 +5,6 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.impl.protocol.deserialization.match;
 
 import static org.junit.Assert.assertEquals;
@@ -14,7 +13,6 @@ import io.netty.buffer.ByteBuf;
 import io.netty.buffer.UnpooledByteBufAllocator;
 import java.util.Iterator;
 import org.junit.Test;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 import org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.common.IpConversionUtil;
 import org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.match.MatchConvertorUtil;
@@ -24,7 +22,6 @@ import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.
 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._3.match.ArpMatch;
 
 public class ArpSourceTransportAddressEntryDeserializerTest extends AbstractMatchEntryDeserializerTest {
-
     @Test
     public void deserializeEntry() {
         final ByteBuf in = UnpooledByteBufAllocator.DEFAULT.buffer();
@@ -62,6 +59,6 @@ public class ArpSourceTransportAddressEntryDeserializerTest extends AbstractMatc
 
     @Override
     protected int getValueLength() {
-        return EncodeConstants.SIZE_OF_INT_IN_BYTES;
+        return Integer.BYTES;
     }
 }
index 1178e5d4741c3997936db0a42ecdc35d8893d2d3..4b9757f5de7b97cad9be903af45192bfa56a0556 100644 (file)
@@ -5,7 +5,6 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.impl.protocol.deserialization.match;
 
 import static org.junit.Assert.assertEquals;
@@ -14,7 +13,6 @@ import io.netty.buffer.ByteBuf;
 import io.netty.buffer.UnpooledByteBufAllocator;
 import java.util.Iterator;
 import org.junit.Test;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 import org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.common.IpConversionUtil;
 import org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.match.MatchConvertorUtil;
@@ -24,7 +22,6 @@ import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.
 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._3.match.ArpMatch;
 
 public class ArpTargetTransportAddressEntryDeserializerTest extends AbstractMatchEntryDeserializerTest {
-
     @Test
     public void deserializeEntry() {
         final ByteBuf in = UnpooledByteBufAllocator.DEFAULT.buffer();
@@ -62,6 +59,6 @@ public class ArpTargetTransportAddressEntryDeserializerTest extends AbstractMatc
 
     @Override
     protected int getValueLength() {
-        return EncodeConstants.SIZE_OF_INT_IN_BYTES;
+        return Integer.BYTES;
     }
 }
index ff4cb122e8287038d88810d24ec5ffa4c7c2c69d..e8d0a55448e951e1ed254603d6de8a901ba81635 100644 (file)
@@ -5,7 +5,6 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.impl.protocol.deserialization.match;
 
 import static org.junit.Assert.assertEquals;
@@ -13,12 +12,10 @@ import static org.junit.Assert.assertEquals;
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.UnpooledByteBufAllocator;
 import org.junit.Test;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 import org.opendaylight.yangtools.yang.common.Uint32;
 
 public class EthernetTypeEntryDeserializerTest extends AbstractMatchEntryDeserializerTest {
-
     @Test
     public void deserializeEntry() {
         final ByteBuf in = UnpooledByteBufAllocator.DEFAULT.buffer();
@@ -44,6 +41,6 @@ public class EthernetTypeEntryDeserializerTest extends AbstractMatchEntryDeseria
 
     @Override
     protected int getValueLength() {
-        return EncodeConstants.SIZE_OF_SHORT_IN_BYTES;
+        return Short.BYTES;
     }
 }
index c9fbf7f17cd3008a18b316162155373319094629..46370d82f13558ddd13dffabef97c6012ad27248 100644 (file)
@@ -5,7 +5,6 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.impl.protocol.deserialization.match;
 
 import static org.junit.Assert.assertEquals;
@@ -13,11 +12,9 @@ import static org.junit.Assert.assertEquals;
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.UnpooledByteBufAllocator;
 import org.junit.Test;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 
 public class Icmpv4CodeEntryDeserializerTest extends AbstractMatchEntryDeserializerTest {
-
     @Test
     public void deserializeEntry() {
         final ByteBuf in = UnpooledByteBufAllocator.DEFAULT.buffer();
@@ -42,6 +39,6 @@ public class Icmpv4CodeEntryDeserializerTest extends AbstractMatchEntryDeseriali
 
     @Override
     protected int getValueLength() {
-        return EncodeConstants.SIZE_OF_BYTE_IN_BYTES;
+        return Byte.BYTES;
     }
 }
index f940f6b5c8484e34932986ffe06a913ed509cdb8..8598cd9437028b6fe0032a7bfea3412c4374740f 100644 (file)
@@ -5,7 +5,6 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.impl.protocol.deserialization.match;
 
 import static org.junit.Assert.assertEquals;
@@ -13,11 +12,9 @@ import static org.junit.Assert.assertEquals;
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.UnpooledByteBufAllocator;
 import org.junit.Test;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 
 public class Icmpv4TypeEntryDeserializerTest extends AbstractMatchEntryDeserializerTest {
-
     @Test
     public void deserializeEntry() {
         final ByteBuf in = UnpooledByteBufAllocator.DEFAULT.buffer();
@@ -42,6 +39,6 @@ public class Icmpv4TypeEntryDeserializerTest extends AbstractMatchEntryDeseriali
 
     @Override
     protected int getValueLength() {
-        return EncodeConstants.SIZE_OF_BYTE_IN_BYTES;
+        return Byte.BYTES;
     }
 }
index 0817d0d67abff6d135b0387244e764e7ae463eab..65a76127bb718b1a5309cdad23bd837dfc8f2a84 100644 (file)
@@ -5,7 +5,6 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.impl.protocol.deserialization.match;
 
 import static org.junit.Assert.assertEquals;
@@ -13,11 +12,9 @@ import static org.junit.Assert.assertEquals;
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.UnpooledByteBufAllocator;
 import org.junit.Test;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 
 public class Icmpv6CodeEntryDeserializerTest extends AbstractMatchEntryDeserializerTest {
-
     @Test
     public void deserializeEntry() {
         final ByteBuf in = UnpooledByteBufAllocator.DEFAULT.buffer();
@@ -42,6 +39,6 @@ public class Icmpv6CodeEntryDeserializerTest extends AbstractMatchEntryDeseriali
 
     @Override
     protected int getValueLength() {
-        return EncodeConstants.SIZE_OF_BYTE_IN_BYTES;
+        return Byte.BYTES;
     }
 }
index 823f004a3739e1f7d0b17b8b70ef757c13a6bd7c..20acab75c2ab2067e20e2858dc904dd121910d45 100644 (file)
@@ -5,7 +5,6 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.impl.protocol.deserialization.match;
 
 import static org.junit.Assert.assertEquals;
@@ -13,11 +12,9 @@ import static org.junit.Assert.assertEquals;
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.UnpooledByteBufAllocator;
 import org.junit.Test;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 
 public class Icmpv6TypeEntryDeserializerTest extends AbstractMatchEntryDeserializerTest {
-
     @Test
     public void deserializeEntry() {
         final ByteBuf in = UnpooledByteBufAllocator.DEFAULT.buffer();
@@ -42,6 +39,6 @@ public class Icmpv6TypeEntryDeserializerTest extends AbstractMatchEntryDeseriali
 
     @Override
     protected int getValueLength() {
-        return EncodeConstants.SIZE_OF_BYTE_IN_BYTES;
+        return Byte.BYTES;
     }
 }
index 2acfb3063de63ce95500fd1ad0dd3fd23b0d7dba..092c5b64594331a806f07995e67dd74aa90ba2d8 100644 (file)
@@ -45,6 +45,6 @@ public class InPhyPortEntryDeserializerTest extends AbstractMatchEntryDeserializ
 
     @Override
     protected int getValueLength() {
-        return EncodeConstants.SIZE_OF_INT_IN_BYTES;
+        return Integer.BYTES;
     }
 }
index 2bed6d9e59dd86889292de7247a2a787063a62dd..18ef398cdc0d6d76fe5df9e97b5de760c1ed0a02 100644 (file)
@@ -45,6 +45,6 @@ public class InPortEntryDeserializerTest extends AbstractMatchEntryDeserializerT
 
     @Override
     protected int getValueLength() {
-        return EncodeConstants.SIZE_OF_INT_IN_BYTES;
+        return Integer.BYTES;
     }
 }
index 8774d03653c9ee3f90e1413a6f27f599239b610b..ba0272a2a12c62016c9159164afcf37d826886ba 100644 (file)
@@ -5,7 +5,6 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.impl.protocol.deserialization.match;
 
 import static org.junit.Assert.assertEquals;
@@ -13,11 +12,9 @@ import static org.junit.Assert.assertEquals;
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.UnpooledByteBufAllocator;
 import org.junit.Test;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 
 public class IpDscpEntryDeserializerTest extends AbstractMatchEntryDeserializerTest {
-
     @Test
     public void deserializeEntry() {
         final ByteBuf in = UnpooledByteBufAllocator.DEFAULT.buffer();
@@ -42,6 +39,6 @@ public class IpDscpEntryDeserializerTest extends AbstractMatchEntryDeserializerT
 
     @Override
     protected int getValueLength() {
-        return EncodeConstants.SIZE_OF_BYTE_IN_BYTES;
+        return Byte.BYTES;
     }
 }
index 9e1b27311dad2d74f734dd2463ae9b320be690e6..2b87dde4604076e3af808ef47718c4b6fa1f7273 100644 (file)
@@ -5,7 +5,6 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.impl.protocol.deserialization.match;
 
 import static org.junit.Assert.assertEquals;
@@ -13,11 +12,9 @@ import static org.junit.Assert.assertEquals;
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.UnpooledByteBufAllocator;
 import org.junit.Test;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 
 public class IpEcnEntryDeserializerTest extends AbstractMatchEntryDeserializerTest {
-
     @Test
     public void deserializeEntry() {
         final ByteBuf in = UnpooledByteBufAllocator.DEFAULT.buffer();
@@ -42,6 +39,6 @@ public class IpEcnEntryDeserializerTest extends AbstractMatchEntryDeserializerTe
 
     @Override
     protected int getValueLength() {
-        return EncodeConstants.SIZE_OF_BYTE_IN_BYTES;
+        return Byte.BYTES;
     }
 }
index 828e57333099541d56bd7f8862c223ff666f0f72..b73c10d6fb026d2601986287314036528a6b698e 100644 (file)
@@ -5,7 +5,6 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.impl.protocol.deserialization.match;
 
 import static org.junit.Assert.assertEquals;
@@ -13,11 +12,9 @@ import static org.junit.Assert.assertEquals;
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.UnpooledByteBufAllocator;
 import org.junit.Test;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 
 public class IpProtoEntryDeserializerTest extends AbstractMatchEntryDeserializerTest {
-
     @Test
     public void deserializeEntry() {
         final ByteBuf in = UnpooledByteBufAllocator.DEFAULT.buffer();
@@ -42,6 +39,6 @@ public class IpProtoEntryDeserializerTest extends AbstractMatchEntryDeserializer
 
     @Override
     protected int getValueLength() {
-        return EncodeConstants.SIZE_OF_BYTE_IN_BYTES;
+        return Byte.BYTES;
     }
 }
index 07a8703fc95d0e0b0af3acca77caaaf0d8705093..3aac8475758aabd60c886890845b7e23db320060 100644 (file)
@@ -5,7 +5,6 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.impl.protocol.deserialization.match;
 
 import static org.junit.Assert.assertEquals;
@@ -13,12 +12,10 @@ import static org.junit.Assert.assertEquals;
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.UnpooledByteBufAllocator;
 import org.junit.Test;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._3.match.Ipv6Match;
 
 public class Ipv6ExtHeaderEntryDeserializerTest extends AbstractMatchEntryDeserializerTest {
-
     @Test
     public void deserializeEntry() {
         final ByteBuf in = UnpooledByteBufAllocator.DEFAULT.buffer();
@@ -54,7 +51,6 @@ public class Ipv6ExtHeaderEntryDeserializerTest extends AbstractMatchEntryDeseri
 
     @Override
     protected int getValueLength() {
-        return EncodeConstants.SIZE_OF_SHORT_IN_BYTES;
+        return Short.BYTES;
     }
-
 }
index 2e926a66d1a88da5df71c45c8adb3899d422727b..2ca4679340239648323464323f520a30af941b8d 100644 (file)
@@ -5,7 +5,6 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.impl.protocol.deserialization.match;
 
 import static org.junit.Assert.assertEquals;
@@ -13,12 +12,10 @@ import static org.junit.Assert.assertEquals;
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.UnpooledByteBufAllocator;
 import org.junit.Test;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._3.match.Ipv6Match;
 
 public class Ipv6FlabelEntryDeserializerTest extends AbstractMatchEntryDeserializerTest {
-
     @Test
     public void deserializeEntry() {
         final ByteBuf in = UnpooledByteBufAllocator.DEFAULT.buffer();
@@ -54,7 +51,6 @@ public class Ipv6FlabelEntryDeserializerTest extends AbstractMatchEntryDeseriali
 
     @Override
     protected int getValueLength() {
-        return EncodeConstants.SIZE_OF_INT_IN_BYTES;
+        return Integer.BYTES;
     }
-
 }
index b4609943031546a3b39ee3d1a888cef09c8d6cde..b2b9c33fa219ff84521df8f706502c1b27b09044 100644 (file)
@@ -5,7 +5,6 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.impl.protocol.deserialization.match;
 
 import static org.junit.Assert.assertEquals;
@@ -13,14 +12,12 @@ import static org.junit.Assert.assertEquals;
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.UnpooledByteBufAllocator;
 import org.junit.Test;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 import org.opendaylight.openflowplugin.openflow.md.util.ByteUtil;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.Metadata;
 import org.opendaylight.yangtools.yang.common.Uint64;
 
 public class MetadataEntryDeserializerTest extends AbstractMatchEntryDeserializerTest {
-
     @Test
     public void deserializeEntry() {
         final ByteBuf in = UnpooledByteBufAllocator.DEFAULT.buffer();
@@ -55,7 +52,6 @@ public class MetadataEntryDeserializerTest extends AbstractMatchEntryDeserialize
 
     @Override
     protected int getValueLength() {
-        return EncodeConstants.SIZE_OF_LONG_IN_BYTES;
+        return Long.BYTES;
     }
-
 }
index c89114f7891653e81a2838e65b1a9c58f650a3e2..960abe8e82a089b1c3a0a0d4c2c40dbade4dd77d 100644 (file)
@@ -5,7 +5,6 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.impl.protocol.deserialization.match;
 
 import static org.junit.Assert.assertEquals;
@@ -13,12 +12,10 @@ import static org.junit.Assert.assertEquals;
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.UnpooledByteBufAllocator;
 import org.junit.Test;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.ProtocolMatchFields;
 
 public class MplsBosEntryDeserializerTest extends AbstractMatchEntryDeserializerTest {
-
     @Test
     public void deserializeEntry() {
         final ByteBuf in = UnpooledByteBufAllocator.DEFAULT.buffer();
@@ -44,7 +41,6 @@ public class MplsBosEntryDeserializerTest extends AbstractMatchEntryDeserializer
 
     @Override
     protected int getValueLength() {
-        return EncodeConstants.SIZE_OF_BYTE_IN_BYTES;
+        return Byte.BYTES;
     }
-
 }
index 45eeda5c0ccb323a30317e5046d9fd6476e066eb..009b06f5d0b511baf9cbb36c82edb6c6d7cea81c 100644 (file)
@@ -5,7 +5,6 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.impl.protocol.deserialization.match;
 
 import static org.junit.Assert.assertEquals;
@@ -13,12 +12,10 @@ import static org.junit.Assert.assertEquals;
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.UnpooledByteBufAllocator;
 import org.junit.Test;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.ProtocolMatchFields;
 
 public class MplsLabelEntryDeserializerTest extends AbstractMatchEntryDeserializerTest {
-
     @Test
     public void deserializeEntry() {
         final ByteBuf in = UnpooledByteBufAllocator.DEFAULT.buffer();
@@ -44,7 +41,6 @@ public class MplsLabelEntryDeserializerTest extends AbstractMatchEntryDeserializ
 
     @Override
     protected int getValueLength() {
-        return EncodeConstants.SIZE_OF_INT_IN_BYTES;
+        return Integer.BYTES;
     }
-
 }
index 3660205c369b5a53481ee92f04c1c0aba530b612..67c67398d2def5e058bc0b66de1c67faf4b873d0 100644 (file)
@@ -5,7 +5,6 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.impl.protocol.deserialization.match;
 
 import static org.junit.Assert.assertEquals;
@@ -13,12 +12,10 @@ import static org.junit.Assert.assertEquals;
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.UnpooledByteBufAllocator;
 import org.junit.Test;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.ProtocolMatchFields;
 
 public class MplsTcEntryDeserializerTest extends AbstractMatchEntryDeserializerTest {
-
     @Test
     public void deserializeEntry() {
         final ByteBuf in = UnpooledByteBufAllocator.DEFAULT.buffer();
@@ -44,7 +41,6 @@ public class MplsTcEntryDeserializerTest extends AbstractMatchEntryDeserializerT
 
     @Override
     protected int getValueLength() {
-        return EncodeConstants.SIZE_OF_BYTE_IN_BYTES;
+        return Byte.BYTES;
     }
-
 }
index c9614bb0000fa0d7c943a3782a25ea0ec9935e8f..9ff7da83f58278865a833afc3afacd03ce207c6e 100644 (file)
@@ -5,7 +5,6 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.impl.protocol.deserialization.match;
 
 import static org.junit.Assert.assertEquals;
@@ -13,13 +12,11 @@ import static org.junit.Assert.assertEquals;
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.UnpooledByteBufAllocator;
 import org.junit.Test;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.Match;
 import org.opendaylight.yangtools.yang.common.Uint32;
 
 public class PacketTypeEntryDeserializerTest extends AbstractMatchEntryDeserializerTest {
-
     @Test
     public void deserializeEntryTest() {
         final ByteBuf in = UnpooledByteBufAllocator.DEFAULT.buffer();
@@ -44,6 +41,6 @@ public class PacketTypeEntryDeserializerTest extends AbstractMatchEntryDeseriali
 
     @Override
     protected int getValueLength() {
-        return EncodeConstants.SIZE_OF_INT_IN_BYTES;
+        return Integer.BYTES;
     }
-}
\ No newline at end of file
+}
index 4456ccf7ed51c7b6f8703b4e13cf556b70d16500..f3fd49f67846ed4a0a156012d96cfd25db4f38e6 100644 (file)
@@ -5,7 +5,6 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.impl.protocol.deserialization.match;
 
 import static org.junit.Assert.assertEquals;
@@ -13,12 +12,10 @@ import static org.junit.Assert.assertEquals;
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.UnpooledByteBufAllocator;
 import org.junit.Test;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._4.match.SctpMatch;
 
 public class SctpDestinationPortEntryDeserializerTest extends AbstractMatchEntryDeserializerTest {
-
     @Test
     public void deserializeEntry() {
         final ByteBuf in = UnpooledByteBufAllocator.DEFAULT.buffer();
@@ -44,6 +41,6 @@ public class SctpDestinationPortEntryDeserializerTest extends AbstractMatchEntry
 
     @Override
     protected int getValueLength() {
-        return EncodeConstants.SIZE_OF_SHORT_IN_BYTES;
+        return Short.BYTES;
     }
 }
index 990a4b26d323a3ff654f1c61f6ce11e0e362e08d..e47960ac9e55be1c688461d544e8aeca633c60e2 100644 (file)
@@ -5,7 +5,6 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.impl.protocol.deserialization.match;
 
 import static org.junit.Assert.assertEquals;
@@ -13,12 +12,10 @@ import static org.junit.Assert.assertEquals;
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.UnpooledByteBufAllocator;
 import org.junit.Test;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._4.match.SctpMatch;
 
 public class SctpSourcePortEntryDeserializerTest extends AbstractMatchEntryDeserializerTest {
-
     @Test
     public void deserializeEntry() {
         final ByteBuf in = UnpooledByteBufAllocator.DEFAULT.buffer();
@@ -44,6 +41,6 @@ public class SctpSourcePortEntryDeserializerTest extends AbstractMatchEntryDeser
 
     @Override
     protected int getValueLength() {
-        return EncodeConstants.SIZE_OF_SHORT_IN_BYTES;
+        return Short.BYTES;
     }
 }
index f033940926187c36e28dae6b66a3461a95f3c1b7..7fcee36ae3135413dd209d04b0d20da1ac140708 100644 (file)
@@ -5,7 +5,6 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.impl.protocol.deserialization.match;
 
 import static org.junit.Assert.assertEquals;
@@ -13,12 +12,10 @@ import static org.junit.Assert.assertEquals;
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.UnpooledByteBufAllocator;
 import org.junit.Test;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._4.match.TcpMatch;
 
 public class TcpDestinationPortEntryDeserializerTest extends AbstractMatchEntryDeserializerTest {
-
     @Test
     public void deserializeEntry() {
         final ByteBuf in = UnpooledByteBufAllocator.DEFAULT.buffer();
@@ -44,6 +41,6 @@ public class TcpDestinationPortEntryDeserializerTest extends AbstractMatchEntryD
 
     @Override
     protected int getValueLength() {
-        return EncodeConstants.SIZE_OF_SHORT_IN_BYTES;
+        return Short.BYTES;
     }
 }
index 8df61aaaa24e697716ada0770ba168b4de8d2a7f..ad83f5ceba544c36b01fbcfc8c7bbecf53d30832 100644 (file)
@@ -56,7 +56,7 @@ public class TcpFlagsEntryDeserializerTest extends AbstractMatchEntryDeserialize
 
     @Override
     protected int getValueLength() {
-        return EncodeConstants.SIZE_OF_SHORT_IN_BYTES;
+        return Short.BYTES;
     }
 
 }
index 6dcf7d00eb71e7c14307cc2984967afd67e3bd1a..e9c93b52b8565e32468fb88fbfacc80f6eb0420c 100644 (file)
@@ -5,7 +5,6 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.impl.protocol.deserialization.match;
 
 import static org.junit.Assert.assertEquals;
@@ -13,12 +12,10 @@ import static org.junit.Assert.assertEquals;
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.UnpooledByteBufAllocator;
 import org.junit.Test;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._4.match.TcpMatch;
 
 public class TcpSourcePortEntryDeserializerTest extends AbstractMatchEntryDeserializerTest {
-
     @Test
     public void deserializeEntry() {
         final ByteBuf in = UnpooledByteBufAllocator.DEFAULT.buffer();
@@ -44,6 +41,6 @@ public class TcpSourcePortEntryDeserializerTest extends AbstractMatchEntryDeseri
 
     @Override
     protected int getValueLength() {
-        return EncodeConstants.SIZE_OF_SHORT_IN_BYTES;
+        return Short.BYTES;
     }
 }
index 49c1e5fd05e806cf38440c89851bcb411c581822..44352c7ff127ecc311aa628b427e15cf19070685 100644 (file)
@@ -5,7 +5,6 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.impl.protocol.deserialization.match;
 
 import static org.junit.Assert.assertArrayEquals;
@@ -15,13 +14,11 @@ import io.netty.buffer.ByteBuf;
 import io.netty.buffer.UnpooledByteBufAllocator;
 import java.math.BigInteger;
 import org.junit.Test;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 import org.opendaylight.openflowplugin.openflow.md.util.ByteUtil;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.Tunnel;
 
 public class TunnelIdEntryDeserializerTest extends AbstractMatchEntryDeserializerTest {
-
     @Test
     public void deserializeEntry() {
         final ByteBuf in = UnpooledByteBufAllocator.DEFAULT.buffer();
@@ -29,25 +26,25 @@ public class TunnelIdEntryDeserializerTest extends AbstractMatchEntryDeserialize
         final BigInteger tunnelIdMask = BigInteger.valueOf(5);
 
         writeHeader(in, false);
-        in.writeBytes(ByteUtil.convertBigIntegerToNBytes(tunnelId, EncodeConstants.SIZE_OF_LONG_IN_BYTES));
+        in.writeBytes(ByteUtil.convertBigIntegerToNBytes(tunnelId, Long.BYTES));
 
         Tunnel match = deserialize(in).getTunnel();
         assertArrayEquals(
-                ByteUtil.convertBigIntegerToNBytes(tunnelId, EncodeConstants.SIZE_OF_LONG_IN_BYTES),
+                ByteUtil.convertBigIntegerToNBytes(tunnelId, Long.BYTES),
                 ByteUtil.uint64toBytes(match.getTunnelId()));
 
         assertEquals(0, in.readableBytes());
 
         writeHeader(in, true);
-        in.writeBytes(ByteUtil.convertBigIntegerToNBytes(tunnelId, EncodeConstants.SIZE_OF_LONG_IN_BYTES));
-        in.writeBytes(ByteUtil.convertBigIntegerToNBytes(tunnelIdMask, EncodeConstants.SIZE_OF_LONG_IN_BYTES));
+        in.writeBytes(ByteUtil.convertBigIntegerToNBytes(tunnelId, Long.BYTES));
+        in.writeBytes(ByteUtil.convertBigIntegerToNBytes(tunnelIdMask, Long.BYTES));
 
         match = deserialize(in).getTunnel();
         assertArrayEquals(
-                ByteUtil.convertBigIntegerToNBytes(tunnelId, EncodeConstants.SIZE_OF_LONG_IN_BYTES),
+                ByteUtil.convertBigIntegerToNBytes(tunnelId, Long.BYTES),
                 ByteUtil.uint64toBytes(match.getTunnelId()));
         assertArrayEquals(
-                ByteUtil.convertBigIntegerToNBytes(tunnelIdMask, EncodeConstants.SIZE_OF_LONG_IN_BYTES),
+                ByteUtil.convertBigIntegerToNBytes(tunnelIdMask, Long.BYTES),
                 ByteUtil.uint64toBytes(match.getTunnelMask()));
         assertEquals(0, in.readableBytes());
     }
@@ -64,7 +61,6 @@ public class TunnelIdEntryDeserializerTest extends AbstractMatchEntryDeserialize
 
     @Override
     protected int getValueLength() {
-        return EncodeConstants.SIZE_OF_LONG_IN_BYTES;
+        return Long.BYTES;
     }
-
 }
index 30a598d6e1a77912ca652902835bff7b2629aac6..84ca8ed7033d2c9599191a72207c85d7e5da477d 100644 (file)
@@ -5,7 +5,6 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.impl.protocol.deserialization.match;
 
 import static org.junit.Assert.assertEquals;
@@ -13,12 +12,10 @@ import static org.junit.Assert.assertEquals;
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.UnpooledByteBufAllocator;
 import org.junit.Test;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._4.match.UdpMatch;
 
 public class UdpDestinationPortEntryDeserializerTest extends AbstractMatchEntryDeserializerTest {
-
     @Test
     public void deserializeEntry() {
         final ByteBuf in = UnpooledByteBufAllocator.DEFAULT.buffer();
@@ -44,6 +41,6 @@ public class UdpDestinationPortEntryDeserializerTest extends AbstractMatchEntryD
 
     @Override
     protected int getValueLength() {
-        return EncodeConstants.SIZE_OF_SHORT_IN_BYTES;
+        return Short.BYTES;
     }
 }
index ed07da294e530c573e95c48d91779a9d31b4967d..0de928afe677dfaf0be2898ae7a4b9997af554e8 100644 (file)
@@ -5,7 +5,6 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.impl.protocol.deserialization.match;
 
 import static org.junit.Assert.assertEquals;
@@ -13,12 +12,10 @@ import static org.junit.Assert.assertEquals;
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.UnpooledByteBufAllocator;
 import org.junit.Test;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._4.match.UdpMatch;
 
 public class UdpSourcePortEntryDeserializerTest extends AbstractMatchEntryDeserializerTest {
-
     @Test
     public void deserializeEntry() {
         final ByteBuf in = UnpooledByteBufAllocator.DEFAULT.buffer();
@@ -44,6 +41,6 @@ public class UdpSourcePortEntryDeserializerTest extends AbstractMatchEntryDeseri
 
     @Override
     protected int getValueLength() {
-        return EncodeConstants.SIZE_OF_SHORT_IN_BYTES;
+        return Short.BYTES;
     }
 }
index 6ee6f289efebdfbd71263bc9dbb044f25c66f9c9..ffbfd19c85ffbd377c3075c112fa8ee89e09dc5b 100644 (file)
@@ -5,7 +5,6 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.impl.protocol.deserialization.match;
 
 import static org.junit.Assert.assertEquals;
@@ -13,11 +12,9 @@ import static org.junit.Assert.assertEquals;
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.UnpooledByteBufAllocator;
 import org.junit.Test;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 
 public class VlanPcpEntryDeserializerTest extends AbstractMatchEntryDeserializerTest {
-
     @Test
     public void deserializeEntry() {
         final ByteBuf in = UnpooledByteBufAllocator.DEFAULT.buffer();
@@ -42,6 +39,6 @@ public class VlanPcpEntryDeserializerTest extends AbstractMatchEntryDeserializer
 
     @Override
     protected int getValueLength() {
-        return EncodeConstants.SIZE_OF_BYTE_IN_BYTES;
+        return Byte.BYTES;
     }
 }
index 14964f0b15b9b3d9baf30ed9cec3fde1ada6ebf6..9d4c22f37f6504ae36933085f2a44a2ee2230a10 100644 (file)
@@ -5,7 +5,6 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.impl.protocol.deserialization.match;
 
 import static org.junit.Assert.assertEquals;
@@ -15,12 +14,10 @@ import static org.junit.Assert.assertTrue;
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.UnpooledByteBufAllocator;
 import org.junit.Test;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.VlanMatch;
 
 public class VlanVidEntryDeserializerTest extends AbstractMatchEntryDeserializerTest {
-
     @Test
     public void deserializeEntry() {
         final ByteBuf in = UnpooledByteBufAllocator.DEFAULT.buffer();
@@ -65,6 +62,6 @@ public class VlanVidEntryDeserializerTest extends AbstractMatchEntryDeserializer
 
     @Override
     protected int getValueLength() {
-        return EncodeConstants.SIZE_OF_SHORT_IN_BYTES;
+        return Short.BYTES;
     }
 }
index 8457bc7ed66718ca07924a12e25e141cff1af1eb..af3162688ad01e421ce66357d5e00bb76a769262 100644 (file)
@@ -94,7 +94,7 @@ public class FlowMessageDeserializerTest extends AbstractDeserializerTest {
         // MplsLabel match
         buffer.writeShort(OxmMatchConstants.OPENFLOW_BASIC_CLASS);
         buffer.writeByte(OxmMatchConstants.MPLS_LABEL << 1);
-        buffer.writeByte(EncodeConstants.SIZE_OF_INT_IN_BYTES);
+        buffer.writeByte(Integer.BYTES);
         buffer.writeInt(MPLS_LABEL);
 
         // Match footer
index 11d3414ee408c770f06ee70a1dcd73089bc48ea1..87af6a92dd16122d51208d43f7a57bdba3db879e 100644 (file)
@@ -58,7 +58,7 @@ public class PacketInMessageDeserializerTest extends AbstractDeserializerTest {
         // MplsLabel match
         buffer.writeShort(OxmMatchConstants.OPENFLOW_BASIC_CLASS);
         buffer.writeByte(OxmMatchConstants.MPLS_LABEL << 1);
-        buffer.writeByte(EncodeConstants.SIZE_OF_INT_IN_BYTES);
+        buffer.writeByte(Integer.BYTES);
         buffer.writeInt(MPLS_LABEL);
 
         // Match footer
index a9c40ffe3d88fe5b31a05e6feb834ac130e40467..4feb681327df12559599cbb1d4e39747217912c8 100644 (file)
@@ -87,7 +87,7 @@ public class MultipartReplyFlowStatsDeserializerTest extends AbstractMultipartDe
         // MplsLabel match
         buffer.writeShort(OxmMatchConstants.OPENFLOW_BASIC_CLASS);
         buffer.writeByte(OxmMatchConstants.MPLS_LABEL << 1);
-        buffer.writeByte(EncodeConstants.SIZE_OF_INT_IN_BYTES);
+        buffer.writeByte(Integer.BYTES);
         buffer.writeInt(MPLS_LABEL);
 
         // Match footer
index f5e181330b258dfbdce2b53ef68079eabe4e1f02..96f018d6be588b2d31e4f47d1cddc4ebcb0aa277 100644 (file)
@@ -101,7 +101,7 @@ public class MultipartReplyMessageDeserializerTest extends AbstractDeserializerT
         // MplsLabel match
         buffer.writeShort(OxmMatchConstants.OPENFLOW_BASIC_CLASS);
         buffer.writeByte(OxmMatchConstants.MPLS_LABEL << 1);
-        buffer.writeByte(EncodeConstants.SIZE_OF_INT_IN_BYTES);
+        buffer.writeByte(Integer.BYTES);
         buffer.writeInt(MPLS_LABEL);
 
         // Match footer
index 4050c3a915c77f50e522bf31ad0addf11abd82e2..8b0be371ec262e1de3fa8bee1a020ae5778600c9 100644 (file)
@@ -32,15 +32,15 @@ public abstract class AbstractSetFieldActionSerializerTest extends AbstractActio
         getSerializer().serialize(action, buffer);
         assertEquals(buffer.readUnsignedShort(), getType());
         assertEquals(buffer.readUnsignedShort(),
-                EncodeConstants.SIZE_OF_SHORT_IN_BYTES // Size of action type
-                        + EncodeConstants.SIZE_OF_SHORT_IN_BYTES // Size of action length
-                        + EncodeConstants.SIZE_OF_SHORT_IN_BYTES // Match entry OXM class
-                        + EncodeConstants.SIZE_OF_BYTE_IN_BYTES // Match entry field and mask
-                        + EncodeConstants.SIZE_OF_BYTE_IN_BYTES // Match entry length
+                Short.BYTES // Size of action type
+                        + Short.BYTES // Size of action length
+                        + Short.BYTES // Match entry OXM class
+                        + Byte.BYTES // Match entry field and mask
+                        + Byte.BYTES // Match entry length
                         + EncodeConstants.PADDING); // Size of set field (match entry)
 
         // Skip match entry header, we have tests for this elsewhere
-        buffer.skipBytes(EncodeConstants.SIZE_OF_INT_IN_BYTES);
+        buffer.skipBytes(Integer.BYTES);
 
         assertBody.accept(buffer);
 
index 6d3beb080e7a9fb9adf13f34f16587b936cd7738..d2bd7f0846bba6194d59191980a1e44c0d4b6bc9 100644 (file)
@@ -5,7 +5,6 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.impl.protocol.serialization.instructions;
 
 import static org.junit.Assert.assertArrayEquals;
@@ -13,7 +12,6 @@ import static org.junit.Assert.assertEquals;
 
 import java.util.Collections;
 import org.junit.Test;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 import org.opendaylight.openflowjava.protocol.impl.util.ActionConstants;
 import org.opendaylight.openflowjava.protocol.impl.util.InstructionConstants;
@@ -29,7 +27,6 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instru
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.instruction.apply.actions._case.ApplyActionsBuilder;
 
 public class ApplyActionsInstructionSerializerTest extends AbstractInstructionSerializerTest {
-
     @Test
     public void testSerialize() {
         final int order = 0;
@@ -54,10 +51,10 @@ public class ApplyActionsInstructionSerializerTest extends AbstractInstructionSe
         assertInstruction(instruction, out -> {
             out.skipBytes(InstructionConstants.PADDING_IN_ACTIONS_INSTRUCTION);
             assertEquals(out.readUnsignedShort(), ActionConstants.SET_FIELD_CODE);
-            out.skipBytes(EncodeConstants.SIZE_OF_SHORT_IN_BYTES); // Skip length of set field action
+            out.skipBytes(Short.BYTES); // Skip length of set field action
             assertEquals(out.readUnsignedShort(), OxmMatchConstants.OPENFLOW_BASIC_CLASS);
             assertEquals(out.readUnsignedByte(), OxmMatchConstants.IPV4_SRC << 1);
-            out.skipBytes(EncodeConstants.SIZE_OF_BYTE_IN_BYTES); // Skip match entry length
+            out.skipBytes(Byte.BYTES); // Skip match entry length
 
             byte[] addressBytes = new byte[4];
             out.readBytes(addressBytes);
@@ -81,5 +78,4 @@ public class ApplyActionsInstructionSerializerTest extends AbstractInstructionSe
     protected int getLength() {
         return 24;
     }
-
 }
index f2707430a635b5920f34c125e9abb83eb68826d1..c6a35d15ac11592e80703131e754c1bcc9e8b645 100644 (file)
@@ -5,7 +5,6 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.impl.protocol.serialization.instructions;
 
 import static org.junit.Assert.assertArrayEquals;
@@ -13,7 +12,6 @@ import static org.junit.Assert.assertEquals;
 
 import java.util.Collections;
 import org.junit.Test;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 import org.opendaylight.openflowjava.protocol.impl.util.ActionConstants;
 import org.opendaylight.openflowjava.protocol.impl.util.InstructionConstants;
@@ -29,7 +27,6 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instru
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.instruction.write.actions._case.WriteActionsBuilder;
 
 public class WriteActionsInstructionSerializerTest extends AbstractInstructionSerializerTest {
-
     @Test
     public void testSerialize() {
         final int order = 0;
@@ -54,10 +51,10 @@ public class WriteActionsInstructionSerializerTest extends AbstractInstructionSe
         assertInstruction(instruction, out -> {
             out.skipBytes(InstructionConstants.PADDING_IN_ACTIONS_INSTRUCTION);
             assertEquals(out.readUnsignedShort(), ActionConstants.SET_FIELD_CODE);
-            out.skipBytes(EncodeConstants.SIZE_OF_SHORT_IN_BYTES); // Skip length of set field action
+            out.skipBytes(Short.BYTES); // Skip length of set field action
             assertEquals(out.readUnsignedShort(), OxmMatchConstants.OPENFLOW_BASIC_CLASS);
             assertEquals(out.readUnsignedByte(), OxmMatchConstants.IPV4_SRC << 1);
-            out.skipBytes(EncodeConstants.SIZE_OF_BYTE_IN_BYTES); // Skip match entry length
+            out.skipBytes(Byte.BYTES); // Skip match entry length
 
             byte[] addressBytes = new byte[4];
             out.readBytes(addressBytes);
@@ -81,5 +78,4 @@ public class WriteActionsInstructionSerializerTest extends AbstractInstructionSe
     protected int getLength() {
         return 24;
     }
-
 }
index e076f87f1ea95af5879f3b0d227940f058d73d7d..9f1fa0cdd6dd43608569a44f9eef706a734f8b72 100644 (file)
@@ -25,15 +25,15 @@ public abstract class AbstractExperimenterMatchEntrySerializerTest extends Abstr
         getSerializer().serialize(match, buffer);
 
         final int length = (hasMask ? 2 : 1) * getLength();
-        final int lengthExp = length + EncodeConstants.SIZE_OF_INT_IN_BYTES; // add length of Experimenter ID
+        final int lengthExp = length + Integer.BYTES; // add length of Experimenter ID
 
         assertEquals(buffer.readShort(), 1); // OXM_MATCH_TYPE
         assertEquals(buffer.readShort(), // Total length of match
-                EncodeConstants.SIZE_OF_SHORT_IN_BYTES // OXM_MATCH_TYPE length
-                        + EncodeConstants.SIZE_OF_SHORT_IN_BYTES // LENGTH length
-                        + EncodeConstants.SIZE_OF_SHORT_IN_BYTES // OXM_CLASS_CODE length
-                        + EncodeConstants.SIZE_OF_BYTE_IN_BYTES // OXM field and mask length
-                        + EncodeConstants.SIZE_OF_BYTE_IN_BYTES // OXM field and mask length length
+                Short.BYTES // OXM_MATCH_TYPE length
+                        + Short.BYTES // LENGTH length
+                        + Short.BYTES // OXM_CLASS_CODE length
+                        + Byte.BYTES // OXM field and mask length
+                        + Byte.BYTES // OXM field and mask length length
                         + lengthExp // length of data in match entry
         );
 
index 16197beb098bd89c584affc0ee3c98b342bf252f..4b427d428e97007f238d301c7756ca1e79ceddf3 100644 (file)
@@ -36,11 +36,11 @@ public abstract class AbstractMatchEntrySerializerTest extends AbstractSerialize
 
         assertEquals(buffer.readShort(), 1); // OXM_MATCH_TYPE
         assertEquals(buffer.readShort(), // Total length of match
-                EncodeConstants.SIZE_OF_SHORT_IN_BYTES // OXM_MATCH_TYPE length
-                        + EncodeConstants.SIZE_OF_SHORT_IN_BYTES // LENGTH length
-                        + EncodeConstants.SIZE_OF_SHORT_IN_BYTES // OXM_CLASS_CODE length
-                        + EncodeConstants.SIZE_OF_BYTE_IN_BYTES // OXM field and mask length
-                        + EncodeConstants.SIZE_OF_BYTE_IN_BYTES // OXM field and mask length length
+                Short.BYTES // OXM_MATCH_TYPE length
+                        + Short.BYTES // LENGTH length
+                        + Short.BYTES // OXM_CLASS_CODE length
+                        + Byte.BYTES // OXM field and mask length
+                        + Byte.BYTES // OXM field and mask length length
                         + length // length of data in match entry
         );
 
index cfd2f7a9b48d396498c47a64df59e2b118724b0a..eeac39a210a770155fcdc3cae90e7a8abd161efe 100644 (file)
@@ -5,20 +5,17 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.impl.protocol.serialization.match;
 
 import static org.junit.Assert.assertEquals;
 
 import org.junit.Test;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.Match;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._3.match.ArpMatchBuilder;
 
 public class ArpOpEntrySerializerTest extends AbstractMatchEntrySerializerTest {
-
     @Test
     public void testSerialize() {
         final int arpOp = 42;
@@ -34,7 +31,7 @@ public class ArpOpEntrySerializerTest extends AbstractMatchEntrySerializerTest {
 
     @Override
     protected short getLength() {
-        return EncodeConstants.SIZE_OF_SHORT_IN_BYTES;
+        return Short.BYTES;
     }
 
     @Override
@@ -46,5 +43,4 @@ public class ArpOpEntrySerializerTest extends AbstractMatchEntrySerializerTest {
     protected int getOxmClassCode() {
         return OxmMatchConstants.OPENFLOW_BASIC_CLASS;
     }
-
-}
\ No newline at end of file
+}
index a3cc7e0ca2e35ad62a586aa5cc77827aaf0cce62..0f65a271c23d82e62b8ab89f635f27024546a739 100644 (file)
@@ -5,13 +5,11 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.impl.protocol.serialization.match;
 
 import static org.junit.Assert.assertArrayEquals;
 
 import org.junit.Test;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Prefix;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder;
@@ -19,7 +17,6 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026
 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._3.match.ArpMatchBuilder;
 
 public class ArpSourceTransportAddressEntrySerializerTest extends AbstractMatchEntrySerializerTest {
-
     @Test
     public void testSerialize() {
         final Match arpSpaMatch = new MatchBuilder()
@@ -53,7 +50,7 @@ public class ArpSourceTransportAddressEntrySerializerTest extends AbstractMatchE
 
     @Override
     protected short getLength() {
-        return EncodeConstants.SIZE_OF_INT_IN_BYTES;
+        return Integer.BYTES;
     }
 
     @Override
@@ -65,5 +62,4 @@ public class ArpSourceTransportAddressEntrySerializerTest extends AbstractMatchE
     protected int getOxmClassCode() {
         return OxmMatchConstants.OPENFLOW_BASIC_CLASS;
     }
-
 }
index 8ab6ab5b34fca6ed4877ed90ec244f5b0f0744fd..2274e14f55839b5d7f9e7245fe8f9d55a23830ef 100644 (file)
@@ -5,13 +5,11 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.impl.protocol.serialization.match;
 
 import static org.junit.Assert.assertArrayEquals;
 
 import org.junit.Test;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Prefix;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder;
@@ -19,7 +17,6 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026
 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._3.match.ArpMatchBuilder;
 
 public class ArpTargetTransportAddressEntrySerializerTest extends AbstractMatchEntrySerializerTest {
-
     @Test
     public void testSerialize() {
         final Match arpSpaMatch = new MatchBuilder()
@@ -53,7 +50,7 @@ public class ArpTargetTransportAddressEntrySerializerTest extends AbstractMatchE
 
     @Override
     protected short getLength() {
-        return EncodeConstants.SIZE_OF_INT_IN_BYTES;
+        return Integer.BYTES;
     }
 
     @Override
@@ -65,5 +62,4 @@ public class ArpTargetTransportAddressEntrySerializerTest extends AbstractMatchE
     protected int getOxmClassCode() {
         return OxmMatchConstants.OPENFLOW_BASIC_CLASS;
     }
-
 }
index e6ee2d72ce8dbbd1a5aafe9b07b51f0d339dad14..393bd01445d3f3916136d4059c424aad753722b1 100644 (file)
@@ -5,13 +5,11 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.impl.protocol.serialization.match;
 
 import static org.junit.Assert.assertEquals;
 
 import org.junit.Test;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.Match;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder;
@@ -20,7 +18,6 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026
 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.EthernetMatchBuilder;
 
 public class EthernetTypeEntrySerializerTest extends AbstractMatchEntrySerializerTest {
-
     @Test
     public void testSerialize() {
         final long ethType = 0xffffL;
@@ -38,7 +35,7 @@ public class EthernetTypeEntrySerializerTest extends AbstractMatchEntrySerialize
 
     @Override
     protected short getLength() {
-        return EncodeConstants.SIZE_OF_SHORT_IN_BYTES;
+        return Short.BYTES;
     }
 
     @Override
@@ -50,5 +47,4 @@ public class EthernetTypeEntrySerializerTest extends AbstractMatchEntrySerialize
     protected int getOxmClassCode() {
         return OxmMatchConstants.OPENFLOW_BASIC_CLASS;
     }
-
 }
index 8edef31229622e77047a34db847a665fa7bfea16..6a7327c5f9e69d885aca057f76c704567a79b77c 100644 (file)
@@ -5,20 +5,17 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.impl.protocol.serialization.match;
 
 import static org.junit.Assert.assertEquals;
 
 import org.junit.Test;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.Match;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.Icmpv4MatchBuilder;
 
 public class Icmpv4CodeEntrySerializerTest extends AbstractMatchEntrySerializerTest {
-
     @Test
     public void testSerialize() {
         final short code = 200;
@@ -34,7 +31,7 @@ public class Icmpv4CodeEntrySerializerTest extends AbstractMatchEntrySerializerT
 
     @Override
     protected short getLength() {
-        return EncodeConstants.SIZE_OF_BYTE_IN_BYTES;
+        return Byte.BYTES;
     }
 
     @Override
@@ -46,5 +43,4 @@ public class Icmpv4CodeEntrySerializerTest extends AbstractMatchEntrySerializerT
     protected int getOxmClassCode() {
         return OxmMatchConstants.OPENFLOW_BASIC_CLASS;
     }
-
 }
index 834aab0cb99094ea99c2fa17aed34e2f225da650..eb0dbbd7b2b948264120a62450418b3ee3358785 100644 (file)
@@ -5,20 +5,17 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.impl.protocol.serialization.match;
 
 import static org.junit.Assert.assertEquals;
 
 import org.junit.Test;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.Match;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.Icmpv4MatchBuilder;
 
 public class Icmpv4TypeEntrySerializerTest extends AbstractMatchEntrySerializerTest {
-
     @Test
     public void testSerialize() {
         final short type = 128;
@@ -34,7 +31,7 @@ public class Icmpv4TypeEntrySerializerTest extends AbstractMatchEntrySerializerT
 
     @Override
     protected short getLength() {
-        return EncodeConstants.SIZE_OF_BYTE_IN_BYTES;
+        return Byte.BYTES;
     }
 
     @Override
@@ -46,5 +43,4 @@ public class Icmpv4TypeEntrySerializerTest extends AbstractMatchEntrySerializerT
     protected int getOxmClassCode() {
         return OxmMatchConstants.OPENFLOW_BASIC_CLASS;
     }
-
 }
index 652637c0d4f8ed7cf91787b7352622d9165707bf..cea7f7f1c427dc9e9677afa82036ef86560b428e 100644 (file)
@@ -5,20 +5,17 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.impl.protocol.serialization.match;
 
 import static org.junit.Assert.assertEquals;
 
 import org.junit.Test;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.Match;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.Icmpv6MatchBuilder;
 
 public class Icmpv6CodeEntrySerializerTest extends AbstractMatchEntrySerializerTest {
-
     @Test
     public void testSerialize() {
         final short code = 101;
@@ -34,7 +31,7 @@ public class Icmpv6CodeEntrySerializerTest extends AbstractMatchEntrySerializerT
 
     @Override
     protected short getLength() {
-        return EncodeConstants.SIZE_OF_BYTE_IN_BYTES;
+        return Byte.BYTES;
     }
 
     @Override
@@ -46,5 +43,4 @@ public class Icmpv6CodeEntrySerializerTest extends AbstractMatchEntrySerializerT
     protected int getOxmClassCode() {
         return OxmMatchConstants.OPENFLOW_BASIC_CLASS;
     }
-
 }
index a6571a2082bd706fd5ec60f42792cab853dd5a26..aaaffb7deeaae6fdcc3dbcdbdebc3424493527b2 100644 (file)
@@ -5,20 +5,17 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.impl.protocol.serialization.match;
 
 import static org.junit.Assert.assertEquals;
 
 import org.junit.Test;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.Match;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.Icmpv6MatchBuilder;
 
 public class Icmpv6TypeEntrySerializerTest extends AbstractMatchEntrySerializerTest {
-
     @Test
     public void testSerialize() {
         final short type = 123;
@@ -34,7 +31,7 @@ public class Icmpv6TypeEntrySerializerTest extends AbstractMatchEntrySerializerT
 
     @Override
     protected short getLength() {
-        return EncodeConstants.SIZE_OF_BYTE_IN_BYTES;
+        return Byte.BYTES;
     }
 
     @Override
@@ -46,5 +43,4 @@ public class Icmpv6TypeEntrySerializerTest extends AbstractMatchEntrySerializerT
     protected int getOxmClassCode() {
         return OxmMatchConstants.OPENFLOW_BASIC_CLASS;
     }
-
 }
index 74bdfe7ff92db2e749a3eb068a91d6ff5f5f7f27..504390b10e6d71ea3701eef40d5c7845a07d21c7 100644 (file)
@@ -5,20 +5,17 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.impl.protocol.serialization.match;
 
 import static org.junit.Assert.assertEquals;
 
 import org.junit.Test;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.Match;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorId;
 
 public class InPhyPortEntrySerializerTest extends AbstractMatchEntrySerializerTest {
-
     @Test
     public void testSerialize() {
         final int port = 10122;
@@ -32,7 +29,7 @@ public class InPhyPortEntrySerializerTest extends AbstractMatchEntrySerializerTe
 
     @Override
     protected short getLength() {
-        return EncodeConstants.SIZE_OF_INT_IN_BYTES;
+        return Integer.BYTES;
     }
 
     @Override
@@ -44,5 +41,4 @@ public class InPhyPortEntrySerializerTest extends AbstractMatchEntrySerializerTe
     protected int getOxmClassCode() {
         return OxmMatchConstants.OPENFLOW_BASIC_CLASS;
     }
-
 }
index d28004ad61e3007a934bee11cb9235face8bb566..ff7028ffcb3d52989c6c235106d84982471d991a 100644 (file)
@@ -5,20 +5,17 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.impl.protocol.serialization.match;
 
 import static org.junit.Assert.assertEquals;
 
 import org.junit.Test;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.Match;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorId;
 
 public class InPortEntrySerializerTest extends AbstractMatchEntrySerializerTest {
-
     @Test
     public void testSerialize() {
         final int port = 42;
@@ -32,7 +29,7 @@ public class InPortEntrySerializerTest extends AbstractMatchEntrySerializerTest
 
     @Override
     protected short getLength() {
-        return EncodeConstants.SIZE_OF_INT_IN_BYTES;
+        return Integer.BYTES;
     }
 
     @Override
@@ -44,5 +41,4 @@ public class InPortEntrySerializerTest extends AbstractMatchEntrySerializerTest
     protected int getOxmClassCode() {
         return OxmMatchConstants.OPENFLOW_BASIC_CLASS;
     }
-
 }
index 00f81698c3fb096b16eea5e05f7ee0fe0414e10b..8638d4cfa22093c1091122a6d31155631eecb662 100644 (file)
@@ -5,13 +5,11 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.impl.protocol.serialization.match;
 
 import static org.junit.Assert.assertEquals;
 
 import org.junit.Test;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Dscp;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.Match;
@@ -19,7 +17,6 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.M
 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.IpMatchBuilder;
 
 public class IpDscpEntrySerializerTest extends AbstractMatchEntrySerializerTest {
-
     @Test
     public void testSerialize() {
         final short dscp = (short) 58;
@@ -35,7 +32,7 @@ public class IpDscpEntrySerializerTest extends AbstractMatchEntrySerializerTest
 
     @Override
     protected short getLength() {
-        return EncodeConstants.SIZE_OF_BYTE_IN_BYTES;
+        return Byte.BYTES;
     }
 
     @Override
@@ -47,5 +44,4 @@ public class IpDscpEntrySerializerTest extends AbstractMatchEntrySerializerTest
     protected int getOxmClassCode() {
         return OxmMatchConstants.OPENFLOW_BASIC_CLASS;
     }
-
 }
index 007aa1639cebefcb7b59c13dd73cf8d5daeb398f..c2ea23e77b6eea87132fc89eecc880fe044fe76d 100644 (file)
@@ -5,20 +5,17 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.impl.protocol.serialization.match;
 
 import static org.junit.Assert.assertEquals;
 
 import org.junit.Test;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.Match;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.IpMatchBuilder;
 
 public class IpEcnEntrySerializerTest extends AbstractMatchEntrySerializerTest {
-
     @Test
     public void testSerialize() {
         final short ecn = (short) 58;
@@ -34,7 +31,7 @@ public class IpEcnEntrySerializerTest extends AbstractMatchEntrySerializerTest {
 
     @Override
     protected short getLength() {
-        return EncodeConstants.SIZE_OF_BYTE_IN_BYTES;
+        return Byte.BYTES;
     }
 
     @Override
@@ -46,5 +43,4 @@ public class IpEcnEntrySerializerTest extends AbstractMatchEntrySerializerTest {
     protected int getOxmClassCode() {
         return OxmMatchConstants.OPENFLOW_BASIC_CLASS;
     }
-
 }
index b552cfc20566b02ae870e5abdc9ea0c37fb9f9d5..e1514a197b657b91b17147bdb31adee0aa2ccf6a 100644 (file)
@@ -5,20 +5,17 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.impl.protocol.serialization.match;
 
 import static org.junit.Assert.assertEquals;
 
 import org.junit.Test;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.Match;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.IpMatchBuilder;
 
 public class IpProtoEntrySerializerTest extends AbstractMatchEntrySerializerTest {
-
     @Test
     public void testSerialize() {
         final short proto = (short) 6; // TCP
@@ -34,7 +31,7 @@ public class IpProtoEntrySerializerTest extends AbstractMatchEntrySerializerTest
 
     @Override
     protected short getLength() {
-        return EncodeConstants.SIZE_OF_BYTE_IN_BYTES;
+        return Byte.BYTES;
     }
 
     @Override
@@ -46,5 +43,4 @@ public class IpProtoEntrySerializerTest extends AbstractMatchEntrySerializerTest
     protected int getOxmClassCode() {
         return OxmMatchConstants.OPENFLOW_BASIC_CLASS;
     }
-
 }
index 3270e1f14dbb61a0eaab727db8bc3bd499a6db4f..7959074a97ddc301ce7e882862f17d7bc63756a7 100644 (file)
@@ -5,13 +5,11 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.impl.protocol.serialization.match;
 
 import static org.junit.Assert.assertArrayEquals;
 
 import org.junit.Test;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Address;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.DottedQuad;
@@ -20,7 +18,6 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026
 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._3.match.Ipv4MatchArbitraryBitMaskBuilder;
 
 public class Ipv4ArbitraryBitMaskDestinationEntrySerializerTest extends AbstractMatchEntrySerializerTest {
-
     @Test
     public void testSerialize() {
         final Ipv4Address ipv4Address = new Ipv4Address("192.168.10.0");
@@ -58,7 +55,7 @@ public class Ipv4ArbitraryBitMaskDestinationEntrySerializerTest extends Abstract
 
     @Override
     protected short getLength() {
-        return EncodeConstants.SIZE_OF_INT_IN_BYTES;
+        return Integer.BYTES;
     }
 
     @Override
@@ -70,5 +67,4 @@ public class Ipv4ArbitraryBitMaskDestinationEntrySerializerTest extends Abstract
     protected int getOxmClassCode() {
         return OxmMatchConstants.OPENFLOW_BASIC_CLASS;
     }
-
 }
index 89166907c73c5ebb075928449f966e2cecee731c..580b3e5b68fc472efe4bb7d8b74769e0c6dabfa3 100644 (file)
@@ -5,13 +5,11 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.impl.protocol.serialization.match;
 
 import static org.junit.Assert.assertArrayEquals;
 
 import org.junit.Test;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Address;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.DottedQuad;
@@ -20,7 +18,6 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026
 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._3.match.Ipv4MatchArbitraryBitMaskBuilder;
 
 public class Ipv4ArbitraryBitMaskSourceEntrySerializerTest extends AbstractMatchEntrySerializerTest {
-
     @Test
     public void testSerialize() {
         final Ipv4Address ipv4Address = new Ipv4Address("192.168.10.0");
@@ -58,7 +55,7 @@ public class Ipv4ArbitraryBitMaskSourceEntrySerializerTest extends AbstractMatch
 
     @Override
     protected short getLength() {
-        return EncodeConstants.SIZE_OF_INT_IN_BYTES;
+        return Integer.BYTES;
     }
 
     @Override
@@ -70,5 +67,4 @@ public class Ipv4ArbitraryBitMaskSourceEntrySerializerTest extends AbstractMatch
     protected int getOxmClassCode() {
         return OxmMatchConstants.OPENFLOW_BASIC_CLASS;
     }
-
 }
index d5ba597efef8bcae4cd55dd640efcf77e94ab275..d7281bafcc549e67ec2719c1bdffed8bfe4af321 100644 (file)
@@ -5,13 +5,11 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.impl.protocol.serialization.match;
 
 import static org.junit.Assert.assertArrayEquals;
 
 import org.junit.Test;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Prefix;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder;
@@ -19,7 +17,6 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026
 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._3.match.Ipv4MatchBuilder;
 
 public class Ipv4DestinationEntrySerializerTest extends AbstractMatchEntrySerializerTest {
-
     @Test
     public void testSerialize() {
         final Match ipv4match = new MatchBuilder()
@@ -53,7 +50,7 @@ public class Ipv4DestinationEntrySerializerTest extends AbstractMatchEntrySerial
 
     @Override
     protected short getLength() {
-        return EncodeConstants.SIZE_OF_INT_IN_BYTES;
+        return Integer.BYTES;
     }
 
     @Override
@@ -65,5 +62,4 @@ public class Ipv4DestinationEntrySerializerTest extends AbstractMatchEntrySerial
     protected int getOxmClassCode() {
         return OxmMatchConstants.OPENFLOW_BASIC_CLASS;
     }
-
 }
index 44ebc2c7f48b7eb7b2d0fc6e9e7910d9351d3953..740553c04dbceb4ec439112b8d64d373975fdc15 100644 (file)
@@ -5,13 +5,11 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.impl.protocol.serialization.match;
 
 import static org.junit.Assert.assertArrayEquals;
 
 import org.junit.Test;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Prefix;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder;
@@ -19,7 +17,6 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026
 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._3.match.Ipv4MatchBuilder;
 
 public class Ipv4SourceEntrySerializerTest extends AbstractMatchEntrySerializerTest {
-
     @Test
     public void testSerialize() {
         final Match ipv4match = new MatchBuilder()
@@ -53,7 +50,7 @@ public class Ipv4SourceEntrySerializerTest extends AbstractMatchEntrySerializerT
 
     @Override
     protected short getLength() {
-        return EncodeConstants.SIZE_OF_INT_IN_BYTES;
+        return Integer.BYTES;
     }
 
     @Override
@@ -65,5 +62,4 @@ public class Ipv4SourceEntrySerializerTest extends AbstractMatchEntrySerializerT
     protected int getOxmClassCode() {
         return OxmMatchConstants.OPENFLOW_BASIC_CLASS;
     }
-
 }
index d450af5f87313b90ec79a3346f616d577c029f76..1d3597886a8d1d25524d70913608b0602063169c 100644 (file)
@@ -5,14 +5,12 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.impl.protocol.serialization.match;
 
 import static org.junit.Assert.assertArrayEquals;
 import static org.junit.Assert.assertEquals;
 
 import org.junit.Test;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 import org.opendaylight.openflowplugin.openflow.md.util.ByteUtil;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder;
@@ -21,7 +19,6 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026
 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._3.match.Ipv6MatchBuilder;
 
 public class Ipv6ExtHeaderEntrySerializerTest extends AbstractMatchEntrySerializerTest {
-
     @Test
     public void testSerialize() {
         final int ipv6extHdr = 358;
@@ -57,7 +54,7 @@ public class Ipv6ExtHeaderEntrySerializerTest extends AbstractMatchEntrySerializ
 
     @Override
     protected short getLength() {
-        return EncodeConstants.SIZE_OF_SHORT_IN_BYTES;
+        return Short.BYTES;
     }
 
     @Override
@@ -69,5 +66,4 @@ public class Ipv6ExtHeaderEntrySerializerTest extends AbstractMatchEntrySerializ
     protected int getOxmClassCode() {
         return OxmMatchConstants.OPENFLOW_BASIC_CLASS;
     }
-
 }
index 373a545856e342219a0213cce20e3eb970e9327f..9d4b084e6a2e20d188c5c21b70f3bbcda7122281 100644 (file)
@@ -5,14 +5,12 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.impl.protocol.serialization.match;
 
 import static org.junit.Assert.assertArrayEquals;
 import static org.junit.Assert.assertEquals;
 
 import org.junit.Test;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 import org.opendaylight.openflowplugin.openflow.md.util.ByteUtil;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv6FlowLabel;
@@ -22,7 +20,6 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026
 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._3.match.Ipv6MatchBuilder;
 
 public class Ipv6LabelEntrySerializerTest extends AbstractMatchEntrySerializerTest {
-
     @Test
     public void testSerialize() {
         final long ipv6flowLabel = 358;
@@ -58,7 +55,7 @@ public class Ipv6LabelEntrySerializerTest extends AbstractMatchEntrySerializerTe
 
     @Override
     protected short getLength() {
-        return EncodeConstants.SIZE_OF_INT_IN_BYTES;
+        return Integer.BYTES;
     }
 
     @Override
@@ -70,5 +67,4 @@ public class Ipv6LabelEntrySerializerTest extends AbstractMatchEntrySerializerTe
     protected int getOxmClassCode() {
         return OxmMatchConstants.OPENFLOW_BASIC_CLASS;
     }
-
 }
index daa750717e856b11c425fbc089f75b025c86f233..4d72c27073ab895b334b5e811ff2a5980ff7d973 100644 (file)
@@ -5,7 +5,6 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.impl.protocol.serialization.match;
 
 import static org.junit.Assert.assertArrayEquals;
@@ -13,14 +12,12 @@ import static org.junit.Assert.assertArrayEquals;
 import com.google.common.primitives.Longs;
 import java.math.BigInteger;
 import org.junit.Test;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.Match;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.MetadataBuilder;
 
 public class MetadataEntrySerializerTest extends AbstractMatchEntrySerializerTest {
-
     @Test
     public void testSerialize() {
         final byte[] metadata = new byte[] { 0, 1, 2, 3, 4, 5, 6, 7 };
@@ -59,7 +56,7 @@ public class MetadataEntrySerializerTest extends AbstractMatchEntrySerializerTes
 
     @Override
     protected short getLength() {
-        return EncodeConstants.SIZE_OF_LONG_IN_BYTES;
+        return Long.BYTES;
     }
 
     @Override
@@ -71,5 +68,4 @@ public class MetadataEntrySerializerTest extends AbstractMatchEntrySerializerTes
     protected int getOxmClassCode() {
         return OxmMatchConstants.OPENFLOW_BASIC_CLASS;
     }
-
 }
index 4d84fc5956713256304d2ea75db759d88ff5e4f2..d2e27731587f8618df425517858c9a690480c937 100644 (file)
@@ -5,20 +5,17 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.impl.protocol.serialization.match;
 
 import static org.junit.Assert.assertEquals;
 
 import org.junit.Test;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.Match;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.ProtocolMatchFieldsBuilder;
 
 public class MplsBosEntrySerializerTest extends AbstractMatchEntrySerializerTest {
-
     @Test
     public void testSerialize() {
         final short mplsBos = (short) 1;
@@ -35,7 +32,7 @@ public class MplsBosEntrySerializerTest extends AbstractMatchEntrySerializerTest
 
     @Override
     protected short getLength() {
-        return EncodeConstants.SIZE_OF_BYTE_IN_BYTES;
+        return Byte.BYTES;
     }
 
     @Override
@@ -47,5 +44,4 @@ public class MplsBosEntrySerializerTest extends AbstractMatchEntrySerializerTest
     protected int getOxmClassCode() {
         return OxmMatchConstants.OPENFLOW_BASIC_CLASS;
     }
-
 }
index ba205e73f20174d3e17de5f12d8cf315e14135e4..50650d2350c8811228fb887e1140fb2fce8f3a74 100644 (file)
@@ -5,20 +5,17 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.impl.protocol.serialization.match;
 
 import static org.junit.Assert.assertEquals;
 
 import org.junit.Test;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.Match;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.ProtocolMatchFieldsBuilder;
 
 public class MplsLabelEntrySerializerTest extends AbstractMatchEntrySerializerTest {
-
     @Test
     public void testSerialize() {
         final long mplsLabel = 10L;
@@ -34,7 +31,7 @@ public class MplsLabelEntrySerializerTest extends AbstractMatchEntrySerializerTe
 
     @Override
     protected short getLength() {
-        return EncodeConstants.SIZE_OF_INT_IN_BYTES;
+        return Integer.BYTES;
     }
 
     @Override
@@ -46,5 +43,4 @@ public class MplsLabelEntrySerializerTest extends AbstractMatchEntrySerializerTe
     protected int getOxmClassCode() {
         return OxmMatchConstants.OPENFLOW_BASIC_CLASS;
     }
-
 }
index cd941efd27f8c4df3120796a232d399443125d8c..f01b89d67924adad2441aaacbb16801b479ebfe3 100644 (file)
@@ -5,20 +5,17 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.impl.protocol.serialization.match;
 
 import static org.junit.Assert.assertEquals;
 
 import org.junit.Test;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.Match;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.ProtocolMatchFieldsBuilder;
 
 public class MplsTcEntrySerializerTest extends AbstractMatchEntrySerializerTest {
-
     @Test
     public void testSerialize() {
         final short mplsTc = (short) 1;
@@ -34,7 +31,7 @@ public class MplsTcEntrySerializerTest extends AbstractMatchEntrySerializerTest
 
     @Override
     protected short getLength() {
-        return EncodeConstants.SIZE_OF_BYTE_IN_BYTES;
+        return Byte.BYTES;
     }
 
     @Override
@@ -46,5 +43,4 @@ public class MplsTcEntrySerializerTest extends AbstractMatchEntrySerializerTest
     protected int getOxmClassCode() {
         return OxmMatchConstants.OPENFLOW_BASIC_CLASS;
     }
-
 }
index acaa8da87e7983a474247af2f92e26ed2cb3cf66..0085c6cccbd9d34596034200de537c999e6b6b18 100644 (file)
@@ -5,13 +5,11 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.impl.protocol.serialization.match;
 
 import static org.junit.Assert.assertEquals;
 
 import org.junit.Test;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.Match;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder;
@@ -19,7 +17,6 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026
 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.PacketTypeMatchBuilder;
 
 public class PacketTypeEntrySerializerTest extends AbstractMatchEntrySerializerTest {
-
     @Test
     public void serializeTest() {
         final long packetType = 0x1894f;
@@ -42,6 +39,6 @@ public class PacketTypeEntrySerializerTest extends AbstractMatchEntrySerializerT
 
     @Override
     protected short getLength() {
-        return EncodeConstants.SIZE_OF_INT_IN_BYTES;
+        return Integer.BYTES;
     }
-}
\ No newline at end of file
+}
index b9b936c5a1647470adf9b884d2355b70f9dbda42..c236e1b361b810985fc63104982622a48f182bde 100644 (file)
@@ -5,13 +5,11 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.impl.protocol.serialization.match;
 
 import static org.junit.Assert.assertEquals;
 
 import org.junit.Test;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.PortNumber;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder;
@@ -19,7 +17,6 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026
 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._4.match.SctpMatchBuilder;
 
 public class SctpDestinationPortEntrySerializerTest extends AbstractMatchEntrySerializerTest {
-
     @Test
     public void testSerialize() {
         final int sctp = 10;
@@ -35,7 +32,7 @@ public class SctpDestinationPortEntrySerializerTest extends AbstractMatchEntrySe
 
     @Override
     protected short getLength() {
-        return EncodeConstants.SIZE_OF_SHORT_IN_BYTES;
+        return Short.BYTES;
     }
 
     @Override
@@ -47,5 +44,4 @@ public class SctpDestinationPortEntrySerializerTest extends AbstractMatchEntrySe
     protected int getOxmClassCode() {
         return OxmMatchConstants.OPENFLOW_BASIC_CLASS;
     }
-
 }
index 2b6ec038bc91266b94699bda19c82bfc0f16142c..67a35caf7fe1c508b41377d98a3a74d36010da38 100644 (file)
@@ -5,13 +5,11 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.impl.protocol.serialization.match;
 
 import static org.junit.Assert.assertEquals;
 
 import org.junit.Test;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.PortNumber;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder;
@@ -19,7 +17,6 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026
 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._4.match.SctpMatchBuilder;
 
 public class SctpSourcePortEntrySerializerTest extends AbstractMatchEntrySerializerTest {
-
     @Test
     public void testSerialize() {
         final int sctp = 10;
@@ -35,7 +32,7 @@ public class SctpSourcePortEntrySerializerTest extends AbstractMatchEntrySeriali
 
     @Override
     protected short getLength() {
-        return EncodeConstants.SIZE_OF_SHORT_IN_BYTES;
+        return Short.BYTES;
     }
 
     @Override
@@ -47,5 +44,4 @@ public class SctpSourcePortEntrySerializerTest extends AbstractMatchEntrySeriali
     protected int getOxmClassCode() {
         return OxmMatchConstants.OPENFLOW_BASIC_CLASS;
     }
-
 }
index f8ef1777db3ab5ae02414be3efab3c1dd1d27451..1ebc6b5fbe64975122badba70d75b51b37e0da4d 100644 (file)
@@ -5,13 +5,11 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.impl.protocol.serialization.match;
 
 import static org.junit.Assert.assertEquals;
 
 import org.junit.Test;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.PortNumber;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder;
@@ -19,7 +17,6 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026
 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._4.match.TcpMatchBuilder;
 
 public class TcpDestinationPortEntrySerializerTest extends AbstractMatchEntrySerializerTest {
-
     @Test
     public void testSerialize() {
         final int tcp = 10;
@@ -35,7 +32,7 @@ public class TcpDestinationPortEntrySerializerTest extends AbstractMatchEntrySer
 
     @Override
     protected short getLength() {
-        return EncodeConstants.SIZE_OF_SHORT_IN_BYTES;
+        return Short.BYTES;
     }
 
     @Override
@@ -47,5 +44,4 @@ public class TcpDestinationPortEntrySerializerTest extends AbstractMatchEntrySer
     protected int getOxmClassCode() {
         return OxmMatchConstants.OPENFLOW_BASIC_CLASS;
     }
-
 }
index 6f1bf1a3a90abac586db327a542a53eb8304afeb..30732f87e22dd6ecfdcf7069ec8162bc62afc48d 100644 (file)
@@ -52,7 +52,7 @@ public class TcpFlagsEntrySerializerTest extends AbstractExperimenterMatchEntryS
 
     @Override
     protected short getLength() {
-        return EncodeConstants.SIZE_OF_SHORT_IN_BYTES;
+        return Short.BYTES;
     }
 
     @Override
index df337713896e99bfcb7d0935ed1eee6f06774bf3..bea689d1e45767365af61a3bbd187c9ddda2caea 100644 (file)
@@ -5,13 +5,11 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.impl.protocol.serialization.match;
 
 import static org.junit.Assert.assertEquals;
 
 import org.junit.Test;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.PortNumber;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder;
@@ -19,7 +17,6 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026
 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._4.match.TcpMatchBuilder;
 
 public class TcpSourcePortEntrySerializerTest extends AbstractMatchEntrySerializerTest {
-
     @Test
     public void testSerialize() {
         final int tcp = 10;
@@ -35,7 +32,7 @@ public class TcpSourcePortEntrySerializerTest extends AbstractMatchEntrySerializ
 
     @Override
     protected short getLength() {
-        return EncodeConstants.SIZE_OF_SHORT_IN_BYTES;
+        return Short.BYTES;
     }
 
     @Override
@@ -47,5 +44,4 @@ public class TcpSourcePortEntrySerializerTest extends AbstractMatchEntrySerializ
     protected int getOxmClassCode() {
         return OxmMatchConstants.OPENFLOW_BASIC_CLASS;
     }
-
 }
index 044c252635d4bdd31166464d4654ddf557a5292f..f6957f81073dd014782d895e87f7f20833cd0ebb 100644 (file)
@@ -5,7 +5,6 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.impl.protocol.serialization.match;
 
 import static org.junit.Assert.assertArrayEquals;
@@ -14,14 +13,12 @@ import static org.junit.Assert.assertEquals;
 import java.math.BigInteger;
 import java.nio.ByteBuffer;
 import org.junit.Test;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.Match;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.TunnelBuilder;
 
 public class TunnelIdEntrySerializerTest extends AbstractMatchEntrySerializerTest {
-
     @Test
     public void testSerialize() {
         final long tunnelId = 8;
@@ -57,7 +54,7 @@ public class TunnelIdEntrySerializerTest extends AbstractMatchEntrySerializerTes
 
     @Override
     protected short getLength() {
-        return EncodeConstants.SIZE_OF_LONG_IN_BYTES;
+        return Long.BYTES;
     }
 
     @Override
@@ -69,5 +66,4 @@ public class TunnelIdEntrySerializerTest extends AbstractMatchEntrySerializerTes
     protected int getOxmClassCode() {
         return OxmMatchConstants.OPENFLOW_BASIC_CLASS;
     }
-
 }
index 4baad60e59de95c5b52f3afcc52301f7558dd3b1..465302e71fc171ed291eab57dcdafa16fbd36075 100644 (file)
@@ -5,13 +5,11 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.impl.protocol.serialization.match;
 
 import static org.junit.Assert.assertArrayEquals;
 
 import org.junit.Test;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Prefix;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder;
@@ -19,7 +17,6 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026
 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._3.match.TunnelIpv4MatchBuilder;
 
 public class TunnelIpv4DestinationEntrySerializerTest extends AbstractMatchEntrySerializerTest {
-
     @Test
     public void testSerialize() {
         final Match ipv4match = new MatchBuilder()
@@ -53,7 +50,7 @@ public class TunnelIpv4DestinationEntrySerializerTest extends AbstractMatchEntry
 
     @Override
     protected short getLength() {
-        return EncodeConstants.SIZE_OF_INT_IN_BYTES;
+        return Integer.BYTES;
     }
 
     @Override
@@ -65,5 +62,4 @@ public class TunnelIpv4DestinationEntrySerializerTest extends AbstractMatchEntry
     protected int getOxmClassCode() {
         return OxmMatchConstants.OPENFLOW_BASIC_CLASS;
     }
-
 }
index 591362a64c96b6916e49a31409698e43b876e586..b8be63c439645d70cd4a4bc5715b62c86b729ae7 100644 (file)
@@ -5,13 +5,11 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.impl.protocol.serialization.match;
 
 import static org.junit.Assert.assertArrayEquals;
 
 import org.junit.Test;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Prefix;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder;
@@ -19,7 +17,6 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026
 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._3.match.TunnelIpv4MatchBuilder;
 
 public class TunnelIpv4SourceEntrySerializerTest extends AbstractMatchEntrySerializerTest {
-
     @Test
     public void testSerialize() {
         final Match ipv4match = new MatchBuilder()
@@ -53,7 +50,7 @@ public class TunnelIpv4SourceEntrySerializerTest extends AbstractMatchEntrySeria
 
     @Override
     protected short getLength() {
-        return EncodeConstants.SIZE_OF_INT_IN_BYTES;
+        return Integer.BYTES;
     }
 
     @Override
@@ -65,5 +62,4 @@ public class TunnelIpv4SourceEntrySerializerTest extends AbstractMatchEntrySeria
     protected int getOxmClassCode() {
         return OxmMatchConstants.OPENFLOW_BASIC_CLASS;
     }
-
 }
index dcc9b16c29636988d3e07386190b90bfec38a771..ad6226dc36479ed02ca7cc9fd61daea6765e2e9e 100644 (file)
@@ -5,13 +5,11 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.impl.protocol.serialization.match;
 
 import static org.junit.Assert.assertEquals;
 
 import org.junit.Test;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.PortNumber;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder;
@@ -19,7 +17,6 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026
 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._4.match.UdpMatchBuilder;
 
 public class UdpDestinationPortEntrySerializerTest extends AbstractMatchEntrySerializerTest {
-
     @Test
     public void testSerialize() {
         final int tcp = 10;
@@ -35,7 +32,7 @@ public class UdpDestinationPortEntrySerializerTest extends AbstractMatchEntrySer
 
     @Override
     protected short getLength() {
-        return EncodeConstants.SIZE_OF_SHORT_IN_BYTES;
+        return Short.BYTES;
     }
 
     @Override
@@ -47,5 +44,4 @@ public class UdpDestinationPortEntrySerializerTest extends AbstractMatchEntrySer
     protected int getOxmClassCode() {
         return OxmMatchConstants.OPENFLOW_BASIC_CLASS;
     }
-
 }
index 5bf0b39b59346397eb0369584ab8dc24a42d27a5..782661918f64f138b436c34942be9ed1d85f3e94 100644 (file)
@@ -5,13 +5,11 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.impl.protocol.serialization.match;
 
 import static org.junit.Assert.assertEquals;
 
 import org.junit.Test;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.PortNumber;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder;
@@ -19,7 +17,6 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026
 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._4.match.UdpMatchBuilder;
 
 public class UdpSourcePortEntrySerializerTest extends AbstractMatchEntrySerializerTest {
-
     @Test
     public void testSerialize() {
         final int tcp = 10;
@@ -35,7 +32,7 @@ public class UdpSourcePortEntrySerializerTest extends AbstractMatchEntrySerializ
 
     @Override
     protected short getLength() {
-        return EncodeConstants.SIZE_OF_SHORT_IN_BYTES;
+        return Short.BYTES;
     }
 
     @Override
@@ -47,5 +44,4 @@ public class UdpSourcePortEntrySerializerTest extends AbstractMatchEntrySerializ
     protected int getOxmClassCode() {
         return OxmMatchConstants.OPENFLOW_BASIC_CLASS;
     }
-
 }
index 109ebf8752797887aa19aa11a599f347073f98a4..810d9be90eed33cef9c85f0d11c0a7b194bfe87d 100644 (file)
@@ -5,13 +5,11 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.impl.protocol.serialization.match;
 
 import static org.junit.Assert.assertEquals;
 
 import org.junit.Test;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.l2.types.rev130827.VlanPcp;
@@ -19,7 +17,6 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026
 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.VlanMatchBuilder;
 
 public class VlanPcpEntrySerializerTest extends AbstractMatchEntrySerializerTest {
-
     @Test
     public void testSerialize() {
         final short vlan = (short) 1;
@@ -35,7 +32,7 @@ public class VlanPcpEntrySerializerTest extends AbstractMatchEntrySerializerTest
 
     @Override
     protected short getLength() {
-        return EncodeConstants.SIZE_OF_BYTE_IN_BYTES;
+        return Byte.BYTES;
     }
 
     @Override
@@ -47,5 +44,4 @@ public class VlanPcpEntrySerializerTest extends AbstractMatchEntrySerializerTest
     protected int getOxmClassCode() {
         return OxmMatchConstants.OPENFLOW_BASIC_CLASS;
     }
-
 }
index 03dd37657053714e51724dd12fcee1519a4d15e6..e0f3e99e35b772a989dc46f0f503aa68e9fc36b0 100644 (file)
@@ -5,14 +5,12 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.impl.protocol.serialization.match;
 
 import static org.junit.Assert.assertArrayEquals;
 import static org.junit.Assert.assertEquals;
 
 import org.junit.Test;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.l2.types.rev130827.VlanId;
@@ -21,7 +19,6 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026
 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.vlan.match.fields.VlanIdBuilder;
 
 public class VlanVidEntrySerializerTest extends AbstractMatchEntrySerializerTest {
-
     @Test
     public void testSerialize() {
         final int vlan = (short) 1;
@@ -56,7 +53,7 @@ public class VlanVidEntrySerializerTest extends AbstractMatchEntrySerializerTest
 
     @Override
     protected short getLength() {
-        return EncodeConstants.SIZE_OF_SHORT_IN_BYTES;
+        return Short.BYTES;
     }
 
     @Override
@@ -68,5 +65,4 @@ public class VlanVidEntrySerializerTest extends AbstractMatchEntrySerializerTest
     protected int getOxmClassCode() {
         return OxmMatchConstants.OPENFLOW_BASIC_CLASS;
     }
-
 }
index cf9a024d8c6a1940b712bd2efb28404ab1fd4072..32e128555bfcd2b710613343afc72b40bdef8282 100644 (file)
@@ -228,13 +228,13 @@ public class FlowMessageSerializerTest extends AbstractSerializerTest {
          // Vlan false match
         assertEquals(out.readUnsignedShort(), OxmMatchConstants.OPENFLOW_BASIC_CLASS);
         assertEquals(out.readUnsignedByte(), OxmMatchConstants.VLAN_VID << 1);
-        assertEquals(out.readUnsignedByte(), EncodeConstants.SIZE_OF_SHORT_IN_BYTES);
+        assertEquals(out.readUnsignedByte(), Short.BYTES);
         assertEquals(out.readUnsignedShort(), 0);
 
         // Ip proto match
         assertEquals(out.readUnsignedShort(), OxmMatchConstants.OPENFLOW_BASIC_CLASS);
         assertEquals(out.readUnsignedByte(), OxmMatchConstants.IP_PROTO << 1);
-        assertEquals(out.readUnsignedByte(), EncodeConstants.SIZE_OF_BYTE_IN_BYTES);
+        assertEquals(out.readUnsignedByte(), Byte.BYTES);
         assertEquals(out.readUnsignedByte(), IP_PROTOCOL_MATCH.shortValue());
 
         int paddingRemainder = matchLength % EncodeConstants.PADDING;
@@ -261,7 +261,7 @@ public class FlowMessageSerializerTest extends AbstractSerializerTest {
         assertEquals(out.readUnsignedShort(), setVlanIdLength);
         assertEquals(out.readUnsignedShort(), OxmMatchConstants.OPENFLOW_BASIC_CLASS);
         assertEquals(out.readUnsignedByte(), OxmMatchConstants.VLAN_VID << 1);
-        assertEquals(out.readUnsignedByte(), EncodeConstants.SIZE_OF_SHORT_IN_BYTES);
+        assertEquals(out.readUnsignedByte(), Short.BYTES);
         assertEquals(out.readUnsignedShort(), VLAN_ID | (1 << 12));
 
         paddingRemainder = (out.readerIndex() - setVlanStartIndex) % EncodeConstants.PADDING;
@@ -282,7 +282,7 @@ public class FlowMessageSerializerTest extends AbstractSerializerTest {
         assertEquals(out.readUnsignedShort(), setTpSrcLength);
         assertEquals(out.readUnsignedShort(), OxmMatchConstants.OPENFLOW_BASIC_CLASS);
         assertEquals(out.readUnsignedByte(), OxmMatchConstants.UDP_SRC << 1);
-        assertEquals(out.readUnsignedByte(), EncodeConstants.SIZE_OF_SHORT_IN_BYTES);
+        assertEquals(out.readUnsignedByte(), Short.BYTES);
         assertEquals(out.readUnsignedShort(), TP_SRC_PORT.intValue());
 
         paddingRemainder = (out.readerIndex() - setTpSrcStartIndex) % EncodeConstants.PADDING;
@@ -303,7 +303,7 @@ public class FlowMessageSerializerTest extends AbstractSerializerTest {
         assertEquals(out.readUnsignedShort(), setTpDstLength);
         assertEquals(out.readUnsignedShort(), OxmMatchConstants.OPENFLOW_BASIC_CLASS);
         assertEquals(out.readUnsignedByte(), OxmMatchConstants.UDP_DST << 1);
-        assertEquals(out.readUnsignedByte(), EncodeConstants.SIZE_OF_SHORT_IN_BYTES);
+        assertEquals(out.readUnsignedByte(), Short.BYTES);
         assertEquals(out.readUnsignedShort(), TP_DST_PORT.intValue());
 
         paddingRemainder = (out.readerIndex() - setTpDstStartIndex) % EncodeConstants.PADDING;
@@ -348,7 +348,7 @@ public class FlowMessageSerializerTest extends AbstractSerializerTest {
          // Vlan false match
         assertEquals(out.readUnsignedShort(), OxmMatchConstants.OPENFLOW_BASIC_CLASS);
         assertEquals(out.readUnsignedByte(), OxmMatchConstants.VLAN_VID << 1 | 1);
-        assertEquals(out.readUnsignedByte(), EncodeConstants.SIZE_OF_SHORT_IN_BYTES * 2);
+        assertEquals(out.readUnsignedByte(), Short.BYTES * 2);
         assertEquals(out.readUnsignedShort(), (1 << 12));
         byte[] vlanMask = new byte[2];
         out.readBytes(vlanMask);
@@ -357,7 +357,7 @@ public class FlowMessageSerializerTest extends AbstractSerializerTest {
         // Ip proto match
         assertEquals(out.readUnsignedShort(), OxmMatchConstants.OPENFLOW_BASIC_CLASS);
         assertEquals(out.readUnsignedByte(), OxmMatchConstants.IP_PROTO << 1);
-        assertEquals(out.readUnsignedByte(), EncodeConstants.SIZE_OF_BYTE_IN_BYTES);
+        assertEquals(out.readUnsignedByte(), Byte.BYTES);
         assertEquals(out.readUnsignedByte(), IP_PROTOCOL_MATCH.shortValue());
 
         int paddingRemainder = matchLength % EncodeConstants.PADDING;
@@ -378,7 +378,7 @@ public class FlowMessageSerializerTest extends AbstractSerializerTest {
         assertEquals(out.readUnsignedShort(), setVlanIdLength);
         assertEquals(out.readUnsignedShort(), OxmMatchConstants.OPENFLOW_BASIC_CLASS);
         assertEquals(out.readUnsignedByte(), OxmMatchConstants.VLAN_VID << 1);
-        assertEquals(out.readUnsignedByte(), EncodeConstants.SIZE_OF_SHORT_IN_BYTES);
+        assertEquals(out.readUnsignedByte(), Short.BYTES);
         assertEquals(out.readUnsignedShort(), VLAN_ID | (1 << 12));
 
         paddingRemainder = (out.readerIndex() - setVlanStartIndex) % EncodeConstants.PADDING;
@@ -399,7 +399,7 @@ public class FlowMessageSerializerTest extends AbstractSerializerTest {
         assertEquals(out.readUnsignedShort(), setTpSrcLength);
         assertEquals(out.readUnsignedShort(), OxmMatchConstants.OPENFLOW_BASIC_CLASS);
         assertEquals(out.readUnsignedByte(), OxmMatchConstants.UDP_SRC << 1);
-        assertEquals(out.readUnsignedByte(), EncodeConstants.SIZE_OF_SHORT_IN_BYTES);
+        assertEquals(out.readUnsignedByte(), Short.BYTES);
         assertEquals(out.readUnsignedShort(), TP_SRC_PORT.intValue());
 
         paddingRemainder = (out.readerIndex() - setTpSrcStartIndex) % EncodeConstants.PADDING;
@@ -420,7 +420,7 @@ public class FlowMessageSerializerTest extends AbstractSerializerTest {
         assertEquals(out.readUnsignedShort(), setTpDstLength);
         assertEquals(out.readUnsignedShort(), OxmMatchConstants.OPENFLOW_BASIC_CLASS);
         assertEquals(out.readUnsignedByte(), OxmMatchConstants.UDP_DST << 1);
-        assertEquals(out.readUnsignedByte(), EncodeConstants.SIZE_OF_SHORT_IN_BYTES);
+        assertEquals(out.readUnsignedByte(), Short.BYTES);
         assertEquals(out.readUnsignedShort(), TP_DST_PORT.intValue());
 
         paddingRemainder = (out.readerIndex() - setTpDstStartIndex) % EncodeConstants.PADDING;
index dc4cfdb0783edba3964e5da5a6180a7e3d2f62f2..743ed2fb7b9d07d8f88b7233fa7c81f54944a73d 100644 (file)
@@ -131,14 +131,14 @@ public class GroupMessageSerializerTest extends AbstractSerializerTest {
 
         // Action
         assertEquals(out.readUnsignedShort(), ActionConstants.SET_FIELD_CODE);
-        assertEquals(out.readUnsignedShort(), EncodeConstants.SIZE_OF_SHORT_IN_BYTES // Size of action type
-                        + EncodeConstants.SIZE_OF_SHORT_IN_BYTES // Size of action length
-                        + EncodeConstants.SIZE_OF_SHORT_IN_BYTES // Match entry OXM class
-                        + EncodeConstants.SIZE_OF_BYTE_IN_BYTES // Match entry field and mask
-                        + EncodeConstants.SIZE_OF_BYTE_IN_BYTES // Match entry length
+        assertEquals(out.readUnsignedShort(), Short.BYTES // Size of action type
+                        + Short.BYTES // Size of action length
+                        + Short.BYTES // Match entry OXM class
+                        + Byte.BYTES // Match entry field and mask
+                        + Byte.BYTES // Match entry length
                         + EncodeConstants.PADDING); // Size of set field (match entry)
         // Skip match entry header, we have tests for this elsewhere
-        out.skipBytes(EncodeConstants.SIZE_OF_INT_IN_BYTES);
+        out.skipBytes(Integer.BYTES);
 
         // Actual match body
         byte[] addressBytes = new byte[4];
index 052b4d68206a702581de54210aa895b960d5e7c4..eb10ecdf2f51312008337c59bb618efea72f98b7 100644 (file)
@@ -77,7 +77,7 @@ public class MultipartRequestFlowAggregateStatsSerializerTest extends AbstractSe
 
         assertEquals(out.readUnsignedShort(), OxmMatchConstants.OPENFLOW_BASIC_CLASS);
         assertEquals(out.readUnsignedByte(), OxmMatchConstants.IP_PROTO << 1);
-        assertEquals(out.readUnsignedByte(), EncodeConstants.SIZE_OF_BYTE_IN_BYTES);
+        assertEquals(out.readUnsignedByte(), Byte.BYTES);
         assertEquals(out.readUnsignedByte(), IP_PROTOCOL_MATCH.shortValue());
 
         int paddingRemainder = matchLength % EncodeConstants.PADDING;
index 26b219f73971c605f955dd1eed0a926df7c59bf8..439cc09c4c745364c4192193d75a6185da673cfa 100644 (file)
@@ -77,7 +77,7 @@ public class MultipartRequestFlowStatsSerializerTest extends AbstractSerializerT
 
         assertEquals(out.readUnsignedShort(), OxmMatchConstants.OPENFLOW_BASIC_CLASS);
         assertEquals(out.readUnsignedByte(), OxmMatchConstants.IP_PROTO << 1);
-        assertEquals(out.readUnsignedByte(), EncodeConstants.SIZE_OF_BYTE_IN_BYTES);
+        assertEquals(out.readUnsignedByte(), Byte.BYTES);
         assertEquals(out.readUnsignedByte(), IP_PROTOCOL_MATCH.shortValue());
 
         int paddingRemainder = matchLength % EncodeConstants.PADDING;
index 3bed18f781f46df89d7cee68cd736a4e48de2b4a..22449955f7effd1d409d78fdf7eed7afdf06feff 100644 (file)
@@ -80,14 +80,14 @@ public class MultipartRequestTableFeaturesSerializerTest extends AbstractSeriali
         final ByteBuf out = UnpooledByteBufAllocator.DEFAULT.buffer();
         serializer.serialize(BODY, out);
 
-        out.skipBytes(EncodeConstants.SIZE_OF_SHORT_IN_BYTES); // skip length
+        out.skipBytes(Short.BYTES); // skip length
         assertEquals(TABLE_ID, out.readUnsignedByte());
         out.skipBytes(PADDING_IN_MULTIPART_REQUEST_TABLE_FEATURES_BODY);
         assertEquals(NAME, ByteBufUtils.decodeNullTerminatedString(out, MAX_TABLE_NAME_LENGTH));
-        final byte[] match = new byte[EncodeConstants.SIZE_OF_LONG_IN_BYTES];
+        final byte[] match = new byte[Long.BYTES];
         out.readBytes(match);
         assertEquals(METADATA_MATCH, new BigInteger(1, match));
-        final byte[] write = new byte[EncodeConstants.SIZE_OF_LONG_IN_BYTES];
+        final byte[] write = new byte[Long.BYTES];
         out.readBytes(write);
         assertEquals(METADATA_WRITE, new BigInteger(1, write));
         assertEquals(IS_DEPRECATED_MASK, (out.readUnsignedInt() & 3) != 0);
index d97df08194cfe73fe2084b1b5ff938a268127266..23a76a7045d4ebf71c09705c16b0d721baf18cb1 100644 (file)
@@ -5,14 +5,12 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures;
 
 import static org.junit.Assert.assertEquals;
 
 import java.util.Collections;
 import org.junit.Test;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.impl.util.ActionConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetNwSrcActionCaseBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.ActionBuilder;
@@ -22,7 +20,6 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table
 import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.ApplyActionsMissBuilder;
 
 public class ApplyActionsMissTablePropertySerializerTest extends AbstractTablePropertySerializerTest {
-
     @Test
     public void testSerialize() {
         final ApplyActionsMiss property = new ApplyActionsMissBuilder()
@@ -39,7 +36,7 @@ public class ApplyActionsMissTablePropertySerializerTest extends AbstractTablePr
 
         assertProperty(property, out -> {
             assertEquals(out.readUnsignedShort(), ActionConstants.SET_FIELD_CODE);
-            out.skipBytes(EncodeConstants.SIZE_OF_SHORT_IN_BYTES); // Skip length of set field action
+            out.skipBytes(Short.BYTES); // Skip length of set field action
         });
     }
 
@@ -52,5 +49,4 @@ public class ApplyActionsMissTablePropertySerializerTest extends AbstractTablePr
     protected int getType() {
         return TableFeaturesPropType.OFPTFPTAPPLYACTIONSMISS.getIntValue();
     }
-
 }
index d1ad4fbca21413a75aac3ad2dd01717334ad9a1e..b4e6019b82b8defd48d64f67660c0ac062b9e8dd 100644 (file)
@@ -5,14 +5,12 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures;
 
 import static org.junit.Assert.assertEquals;
 
 import java.util.Collections;
 import org.junit.Test;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.impl.util.ActionConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetNwSrcActionCaseBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.ActionBuilder;
@@ -22,7 +20,6 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table
 import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.ApplyActionsBuilder;
 
 public class ApplyActionsTablePropertySerializerTest extends AbstractTablePropertySerializerTest {
-
     @Test
     public void testSerialize() {
         final ApplyActions property = new ApplyActionsBuilder()
@@ -39,7 +36,7 @@ public class ApplyActionsTablePropertySerializerTest extends AbstractTableProper
 
         assertProperty(property, out -> {
             assertEquals(out.readUnsignedShort(), ActionConstants.SET_FIELD_CODE);
-            out.skipBytes(EncodeConstants.SIZE_OF_SHORT_IN_BYTES); // Skip length of set field action
+            out.skipBytes(Short.BYTES); // Skip length of set field action
         });
     }
 
@@ -52,5 +49,4 @@ public class ApplyActionsTablePropertySerializerTest extends AbstractTableProper
     protected int getType() {
         return TableFeaturesPropType.OFPTFPTAPPLYACTIONS.getIntValue();
     }
-
 }
index 09c4dabca18b3abefa24334e3408e37fa4137d76..b55a880909447eb9a2a36efb8ac347648e36aba8 100644 (file)
@@ -5,14 +5,12 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures;
 
 import static org.junit.Assert.assertEquals;
 
 import com.google.common.collect.ImmutableList;
 import org.junit.Test;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.TableFeaturesPropType;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.ArpOp;
@@ -23,7 +21,6 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table
 import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.ApplySetfieldMissBuilder;
 
 public class ApplySetfieldMissTablePropertySerializerTest extends AbstractTablePropertySerializerTest {
-
     @Test
     public void testSerialize() {
         final ApplySetfieldMiss property = new ApplySetfieldMissBuilder()
@@ -43,7 +40,7 @@ public class ApplySetfieldMissTablePropertySerializerTest extends AbstractTableP
         assertProperty(property, out -> {
             assertEquals(out.readUnsignedShort(), OxmMatchConstants.OPENFLOW_BASIC_CLASS);
             assertEquals(out.readUnsignedByte(), OxmMatchConstants.ARP_OP << 1);
-            out.skipBytes(EncodeConstants.SIZE_OF_BYTE_IN_BYTES); // Skip match entry length
+            out.skipBytes(Byte.BYTES); // Skip match entry length
         });
     }
 
@@ -56,5 +53,4 @@ public class ApplySetfieldMissTablePropertySerializerTest extends AbstractTableP
     protected int getType() {
         return TableFeaturesPropType.OFPTFPTAPPLYSETFIELDMISS.getIntValue();
     }
-
 }
index e19f7dbf8efcf612f76994b033fef7eb701ab487..057251cd6b42345f3f557cb152a66e634257469c 100644 (file)
@@ -5,14 +5,12 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures;
 
 import static org.junit.Assert.assertEquals;
 
 import com.google.common.collect.ImmutableList;
 import org.junit.Test;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.TableFeaturesPropType;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.ArpOp;
@@ -23,7 +21,6 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table
 import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.ApplySetfieldBuilder;
 
 public class ApplySetfieldTablePropertySerializerTest extends AbstractTablePropertySerializerTest {
-
     @Test
     public void testSerialize() {
         final ApplySetfield property = new ApplySetfieldBuilder()
@@ -43,7 +40,7 @@ public class ApplySetfieldTablePropertySerializerTest extends AbstractTablePrope
         assertProperty(property, out -> {
             assertEquals(out.readUnsignedShort(), OxmMatchConstants.OPENFLOW_BASIC_CLASS);
             assertEquals(out.readUnsignedByte(), OxmMatchConstants.ARP_OP << 1);
-            out.skipBytes(EncodeConstants.SIZE_OF_BYTE_IN_BYTES); // Skip match entry length
+            out.skipBytes(Byte.BYTES); // Skip match entry length
         });
     }
 
@@ -56,5 +53,4 @@ public class ApplySetfieldTablePropertySerializerTest extends AbstractTablePrope
     protected int getType() {
         return TableFeaturesPropType.OFPTFPTAPPLYSETFIELD.getIntValue();
     }
-
 }
index 388bc993b48359631be3ee0fbdbe5cf9b8fdb6e9..883627d80a65411dd21487129bca05d4d4908020 100644 (file)
@@ -5,14 +5,12 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures;
 
 import static org.junit.Assert.assertEquals;
 
 import java.util.Collections;
 import org.junit.Test;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.impl.util.InstructionConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.instruction.ApplyActionsCaseBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.list.InstructionBuilder;
@@ -22,7 +20,6 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table
 import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.InstructionsMissBuilder;
 
 public class InstructionsMissTablePropertySerializerTest extends AbstractTablePropertySerializerTest {
-
     @Test
     public void testSerialize() {
         final InstructionsMiss property = new InstructionsMissBuilder()
@@ -39,7 +36,7 @@ public class InstructionsMissTablePropertySerializerTest extends AbstractTablePr
 
         assertProperty(property, out -> {
             assertEquals(out.readUnsignedShort(), InstructionConstants.APPLY_ACTIONS_TYPE);
-            out.skipBytes(EncodeConstants.SIZE_OF_SHORT_IN_BYTES); // Skip length of set field action
+            out.skipBytes(Short.BYTES); // Skip length of set field action
         });
     }
 
@@ -52,5 +49,4 @@ public class InstructionsMissTablePropertySerializerTest extends AbstractTablePr
     protected int getType() {
         return TableFeaturesPropType.OFPTFPTINSTRUCTIONSMISS.getIntValue();
     }
-
 }
index a21859275c2798ed420dfa92f60727390e374e21..16b63828736a9eae4b930020f2185e67f4c065e8 100644 (file)
@@ -5,14 +5,12 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures;
 
 import static org.junit.Assert.assertEquals;
 
 import java.util.Collections;
 import org.junit.Test;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.impl.util.InstructionConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.instruction.ApplyActionsCaseBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.list.InstructionBuilder;
@@ -22,7 +20,6 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table
 import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.InstructionsBuilder;
 
 public class InstructionsTablePropertySerializerTest extends AbstractTablePropertySerializerTest {
-
     @Test
     public void testSerialize() {
         final Instructions property = new InstructionsBuilder()
@@ -39,7 +36,7 @@ public class InstructionsTablePropertySerializerTest extends AbstractTableProper
 
         assertProperty(property, out -> {
             assertEquals(out.readUnsignedShort(), InstructionConstants.APPLY_ACTIONS_TYPE);
-            out.skipBytes(EncodeConstants.SIZE_OF_SHORT_IN_BYTES); // Skip length of set field action
+            out.skipBytes(Short.BYTES); // Skip length of set field action
         });
     }
 
@@ -52,5 +49,4 @@ public class InstructionsTablePropertySerializerTest extends AbstractTableProper
     protected int getType() {
         return TableFeaturesPropType.OFPTFPTINSTRUCTIONS.getIntValue();
     }
-
 }
index 1e1a4eda47e472285efbd068938997b7eb8e4377..60591bc853c5997b3b6b9dbf03705e5d7cd28879 100644 (file)
@@ -5,14 +5,12 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures;
 
 import static org.junit.Assert.assertEquals;
 
 import com.google.common.collect.ImmutableList;
 import org.junit.Test;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.TableFeaturesPropType;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.ArpOp;
@@ -24,7 +22,6 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table
 import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.match.MatchSetfieldBuilder;
 
 public class MatchTablePropertySerializerTest extends AbstractTablePropertySerializerTest {
-
     @Test
     public void testSerialize() {
         final Match property = new MatchBuilder()
@@ -42,7 +39,7 @@ public class MatchTablePropertySerializerTest extends AbstractTablePropertySeria
         assertProperty(property, out -> {
             assertEquals(out.readUnsignedShort(), OxmMatchConstants.OPENFLOW_BASIC_CLASS);
             assertEquals(out.readUnsignedByte(), OxmMatchConstants.ARP_OP << 1);
-            out.skipBytes(EncodeConstants.SIZE_OF_BYTE_IN_BYTES); // Skip match entry length
+            out.skipBytes(Byte.BYTES); // Skip match entry length
         });
     }
 
@@ -55,5 +52,4 @@ public class MatchTablePropertySerializerTest extends AbstractTablePropertySeria
     protected int getType() {
         return TableFeaturesPropType.OFPTFPTMATCH.getIntValue();
     }
-
 }
index a91395958c390f9be47a317c995b2efd7d737ae6..f7d25d69844515c919de415993a8c853b35d1bf7 100644 (file)
@@ -5,14 +5,12 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures;
 
 import static org.junit.Assert.assertEquals;
 
 import com.google.common.collect.ImmutableList;
 import org.junit.Test;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.TableFeaturesPropType;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.ArpOp;
@@ -24,7 +22,6 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table
 import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.wildcards.WildcardSetfieldBuilder;
 
 public class WildcardsTablePropertySerializerTest extends AbstractTablePropertySerializerTest {
-
     @Test
     public void testSerialize() {
         final Wildcards property = new WildcardsBuilder()
@@ -42,7 +39,7 @@ public class WildcardsTablePropertySerializerTest extends AbstractTablePropertyS
         assertProperty(property, out -> {
             assertEquals(out.readUnsignedShort(), OxmMatchConstants.OPENFLOW_BASIC_CLASS);
             assertEquals(out.readUnsignedByte(), OxmMatchConstants.ARP_OP << 1);
-            out.skipBytes(EncodeConstants.SIZE_OF_BYTE_IN_BYTES); // Skip match entry length
+            out.skipBytes(Byte.BYTES); // Skip match entry length
         });
     }
 
@@ -55,5 +52,4 @@ public class WildcardsTablePropertySerializerTest extends AbstractTablePropertyS
     protected int getType() {
         return TableFeaturesPropType.OFPTFPTWILDCARDS.getIntValue();
     }
-
 }
index 2dd2aa82a0f0e214417a825cdd41fd620bae04c6..9cb398e161703d6f6ea9daa946ededba73b771d3 100644 (file)
@@ -5,14 +5,12 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures;
 
 import static org.junit.Assert.assertEquals;
 
 import java.util.Collections;
 import org.junit.Test;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.impl.util.ActionConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetNwSrcActionCaseBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.ActionBuilder;
@@ -22,7 +20,6 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table
 import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.WriteActionsMissBuilder;
 
 public class WriteActionsMissTablePropertySerializerTest extends AbstractTablePropertySerializerTest {
-
     @Test
     public void testSerialize() {
         final WriteActionsMiss property = new WriteActionsMissBuilder()
@@ -39,7 +36,7 @@ public class WriteActionsMissTablePropertySerializerTest extends AbstractTablePr
 
         assertProperty(property, out -> {
             assertEquals(out.readUnsignedShort(), ActionConstants.SET_FIELD_CODE);
-            out.skipBytes(EncodeConstants.SIZE_OF_SHORT_IN_BYTES); // Skip length of set field action
+            out.skipBytes(Short.BYTES); // Skip length of set field action
         });
     }
 
@@ -52,5 +49,4 @@ public class WriteActionsMissTablePropertySerializerTest extends AbstractTablePr
     protected int getType() {
         return TableFeaturesPropType.OFPTFPTWRITEACTIONSMISS.getIntValue();
     }
-
 }
index 4ad3c353eb2fb0e7b602f32cd96f960dcc29c48e..850d9e21cdb5054a89f0990025d0245a763e9b8c 100644 (file)
@@ -5,14 +5,12 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures;
 
 import static org.junit.Assert.assertEquals;
 
 import java.util.Collections;
 import org.junit.Test;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.impl.util.ActionConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetNwSrcActionCaseBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.ActionBuilder;
@@ -22,7 +20,6 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table
 import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.WriteActionsBuilder;
 
 public class WriteActionsTablePropertySerializerTest extends AbstractTablePropertySerializerTest {
-
     @Test
     public void testSerialize() {
         final WriteActions property = new WriteActionsBuilder()
@@ -39,7 +36,7 @@ public class WriteActionsTablePropertySerializerTest extends AbstractTableProper
 
         assertProperty(property, out -> {
             assertEquals(out.readUnsignedShort(), ActionConstants.SET_FIELD_CODE);
-            out.skipBytes(EncodeConstants.SIZE_OF_SHORT_IN_BYTES); // Skip length of set field action
+            out.skipBytes(Short.BYTES); // Skip length of set field action
         });
     }
 
@@ -52,5 +49,4 @@ public class WriteActionsTablePropertySerializerTest extends AbstractTableProper
     protected int getType() {
         return TableFeaturesPropType.OFPTFPTWRITEACTIONS.getIntValue();
     }
-
 }
index 658f2795585c363eef39232a6b6ea19330e47de0..6e9d37e04f40b8a6669b48b0309a88f75b87dc6f 100644 (file)
@@ -5,14 +5,12 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures;
 
 import static org.junit.Assert.assertEquals;
 
 import com.google.common.collect.ImmutableList;
 import org.junit.Test;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.TableFeaturesPropType;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.ArpOp;
@@ -23,7 +21,6 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table
 import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.WriteSetfieldMissBuilder;
 
 public class WriteSetfieldMissTablePropertySerializerTest extends AbstractTablePropertySerializerTest {
-
     @Test
     public void testSerialize() {
         final WriteSetfieldMiss property = new WriteSetfieldMissBuilder()
@@ -43,7 +40,7 @@ public class WriteSetfieldMissTablePropertySerializerTest extends AbstractTableP
         assertProperty(property, out -> {
             assertEquals(out.readUnsignedShort(), OxmMatchConstants.OPENFLOW_BASIC_CLASS);
             assertEquals(out.readUnsignedByte(), OxmMatchConstants.ARP_OP << 1);
-            out.skipBytes(EncodeConstants.SIZE_OF_BYTE_IN_BYTES); // Skip match entry length
+            out.skipBytes(Byte.BYTES); // Skip match entry length
         });
     }
 
@@ -56,5 +53,4 @@ public class WriteSetfieldMissTablePropertySerializerTest extends AbstractTableP
     protected int getType() {
         return TableFeaturesPropType.OFPTFPTWRITESETFIELDMISS.getIntValue();
     }
-
 }
index e33888f648e3fac45a1ee3cf884eb4542a5c85c0..3bd68469c7179067bf20b19bf9da12814b9ff5f0 100644 (file)
@@ -5,14 +5,12 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures;
 
 import static org.junit.Assert.assertEquals;
 
 import com.google.common.collect.ImmutableList;
 import org.junit.Test;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.TableFeaturesPropType;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.ArpOp;
@@ -23,7 +21,6 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table
 import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.WriteSetfieldBuilder;
 
 public class WriteSetfieldTablePropertySerializerTest extends AbstractTablePropertySerializerTest {
-
     @Test
     public void testSerialize() {
         final WriteSetfield property = new WriteSetfieldBuilder()
@@ -43,7 +40,7 @@ public class WriteSetfieldTablePropertySerializerTest extends AbstractTablePrope
         assertProperty(property, out -> {
             assertEquals(out.readUnsignedShort(), OxmMatchConstants.OPENFLOW_BASIC_CLASS);
             assertEquals(out.readUnsignedByte(), OxmMatchConstants.ARP_OP << 1);
-            out.skipBytes(EncodeConstants.SIZE_OF_BYTE_IN_BYTES); // Skip match entry length
+            out.skipBytes(Byte.BYTES); // Skip match entry length
         });
     }
 
@@ -56,5 +53,4 @@ public class WriteSetfieldTablePropertySerializerTest extends AbstractTablePrope
     protected int getType() {
         return TableFeaturesPropType.OFPTFPTWRITESETFIELD.getIntValue();
     }
-
 }
index 4c49e0878a56f63dbf446ad2136996c464b4591f..9d805a5cdd1de392c729e4ffd24345ac34e69f5d 100644 (file)
@@ -242,167 +242,167 @@ public class MatchFieldSerializerTest extends AbstractTablePropertySerializerTes
         assertProperty(property, out -> {
             assertEquals(out.readUnsignedShort(), OxmMatchConstants.OPENFLOW_BASIC_CLASS);
             assertEquals(out.readUnsignedByte(), OxmMatchConstants.ARP_OP << 1);
-            out.skipBytes(EncodeConstants.SIZE_OF_BYTE_IN_BYTES);
+            out.skipBytes(Byte.BYTES);
 
             assertEquals(out.readUnsignedShort(), OxmMatchConstants.OPENFLOW_BASIC_CLASS);
             assertEquals(out.readUnsignedByte(), OxmMatchConstants.ARP_SHA << 1);
-            out.skipBytes(EncodeConstants.SIZE_OF_BYTE_IN_BYTES);
+            out.skipBytes(Byte.BYTES);
 
             assertEquals(out.readUnsignedShort(), OxmMatchConstants.OPENFLOW_BASIC_CLASS);
             assertEquals(out.readUnsignedByte(), OxmMatchConstants.ARP_SPA << 1);
-            out.skipBytes(EncodeConstants.SIZE_OF_BYTE_IN_BYTES);
+            out.skipBytes(Byte.BYTES);
 
             assertEquals(out.readUnsignedShort(), OxmMatchConstants.OPENFLOW_BASIC_CLASS);
             assertEquals(out.readUnsignedByte(), OxmMatchConstants.ARP_THA << 1);
-            out.skipBytes(EncodeConstants.SIZE_OF_BYTE_IN_BYTES);
+            out.skipBytes(Byte.BYTES);
 
             assertEquals(out.readUnsignedShort(), OxmMatchConstants.OPENFLOW_BASIC_CLASS);
             assertEquals(out.readUnsignedByte(), OxmMatchConstants.ARP_TPA << 1);
-            out.skipBytes(EncodeConstants.SIZE_OF_BYTE_IN_BYTES);
+            out.skipBytes(Byte.BYTES);
 
             assertEquals(out.readUnsignedShort(), OxmMatchConstants.OPENFLOW_BASIC_CLASS);
             assertEquals(out.readUnsignedByte(), OxmMatchConstants.ETH_DST << 1);
-            out.skipBytes(EncodeConstants.SIZE_OF_BYTE_IN_BYTES);
+            out.skipBytes(Byte.BYTES);
 
             assertEquals(out.readUnsignedShort(), OxmMatchConstants.OPENFLOW_BASIC_CLASS);
             assertEquals(out.readUnsignedByte(), OxmMatchConstants.ETH_SRC << 1);
-            out.skipBytes(EncodeConstants.SIZE_OF_BYTE_IN_BYTES);
+            out.skipBytes(Byte.BYTES);
 
             assertEquals(out.readUnsignedShort(), OxmMatchConstants.OPENFLOW_BASIC_CLASS);
             assertEquals(out.readUnsignedByte(), OxmMatchConstants.ETH_TYPE << 1);
-            out.skipBytes(EncodeConstants.SIZE_OF_BYTE_IN_BYTES);
+            out.skipBytes(Byte.BYTES);
 
             assertEquals(out.readUnsignedShort(), OxmMatchConstants.OPENFLOW_BASIC_CLASS);
             assertEquals(out.readUnsignedByte(), OxmMatchConstants.ICMPV4_CODE << 1);
-            out.skipBytes(EncodeConstants.SIZE_OF_BYTE_IN_BYTES);
+            out.skipBytes(Byte.BYTES);
 
             assertEquals(out.readUnsignedShort(), OxmMatchConstants.OPENFLOW_BASIC_CLASS);
             assertEquals(out.readUnsignedByte(), OxmMatchConstants.ICMPV4_TYPE << 1);
-            out.skipBytes(EncodeConstants.SIZE_OF_BYTE_IN_BYTES);
+            out.skipBytes(Byte.BYTES);
 
             assertEquals(out.readUnsignedShort(), OxmMatchConstants.OPENFLOW_BASIC_CLASS);
             assertEquals(out.readUnsignedByte(), OxmMatchConstants.ICMPV6_CODE << 1);
-            out.skipBytes(EncodeConstants.SIZE_OF_BYTE_IN_BYTES);
+            out.skipBytes(Byte.BYTES);
 
             assertEquals(out.readUnsignedShort(), OxmMatchConstants.OPENFLOW_BASIC_CLASS);
             assertEquals(out.readUnsignedByte(), OxmMatchConstants.ICMPV6_TYPE << 1);
-            out.skipBytes(EncodeConstants.SIZE_OF_BYTE_IN_BYTES);
+            out.skipBytes(Byte.BYTES);
 
             assertEquals(out.readUnsignedShort(), OxmMatchConstants.OPENFLOW_BASIC_CLASS);
             assertEquals(out.readUnsignedByte(), OxmMatchConstants.IN_PHY_PORT << 1);
-            out.skipBytes(EncodeConstants.SIZE_OF_BYTE_IN_BYTES);
+            out.skipBytes(Byte.BYTES);
 
             assertEquals(out.readUnsignedShort(), OxmMatchConstants.OPENFLOW_BASIC_CLASS);
             assertEquals(out.readUnsignedByte(), OxmMatchConstants.IN_PORT << 1);
-            out.skipBytes(EncodeConstants.SIZE_OF_BYTE_IN_BYTES);
+            out.skipBytes(Byte.BYTES);
 
             assertEquals(out.readUnsignedShort(), OxmMatchConstants.OPENFLOW_BASIC_CLASS);
             assertEquals(out.readUnsignedByte(), OxmMatchConstants.IP_DSCP << 1);
-            out.skipBytes(EncodeConstants.SIZE_OF_BYTE_IN_BYTES);
+            out.skipBytes(Byte.BYTES);
 
             assertEquals(out.readUnsignedShort(), OxmMatchConstants.OPENFLOW_BASIC_CLASS);
             assertEquals(out.readUnsignedByte(), OxmMatchConstants.IP_ECN << 1);
-            out.skipBytes(EncodeConstants.SIZE_OF_BYTE_IN_BYTES);
+            out.skipBytes(Byte.BYTES);
 
             assertEquals(out.readUnsignedShort(), OxmMatchConstants.OPENFLOW_BASIC_CLASS);
             assertEquals(out.readUnsignedByte(), OxmMatchConstants.IP_PROTO << 1);
-            out.skipBytes(EncodeConstants.SIZE_OF_BYTE_IN_BYTES);
+            out.skipBytes(Byte.BYTES);
 
             assertEquals(out.readUnsignedShort(), OxmMatchConstants.OPENFLOW_BASIC_CLASS);
             assertEquals(out.readUnsignedByte(), OxmMatchConstants.IPV4_DST << 1);
-            out.skipBytes(EncodeConstants.SIZE_OF_BYTE_IN_BYTES);
+            out.skipBytes(Byte.BYTES);
 
             assertEquals(out.readUnsignedShort(), OxmMatchConstants.OPENFLOW_BASIC_CLASS);
             assertEquals(out.readUnsignedByte(), OxmMatchConstants.IPV4_SRC << 1);
-            out.skipBytes(EncodeConstants.SIZE_OF_BYTE_IN_BYTES);
+            out.skipBytes(Byte.BYTES);
 
             assertEquals(out.readUnsignedShort(), OxmMatchConstants.OPENFLOW_BASIC_CLASS);
             assertEquals(out.readUnsignedByte(), OxmMatchConstants.IPV6_DST << 1);
-            out.skipBytes(EncodeConstants.SIZE_OF_BYTE_IN_BYTES);
+            out.skipBytes(Byte.BYTES);
 
             assertEquals(out.readUnsignedShort(), OxmMatchConstants.OPENFLOW_BASIC_CLASS);
             assertEquals(out.readUnsignedByte(), OxmMatchConstants.IPV6_EXTHDR << 1);
-            out.skipBytes(EncodeConstants.SIZE_OF_BYTE_IN_BYTES);
+            out.skipBytes(Byte.BYTES);
 
             assertEquals(out.readUnsignedShort(), OxmMatchConstants.OPENFLOW_BASIC_CLASS);
             assertEquals(out.readUnsignedByte(), OxmMatchConstants.IPV6_FLABEL << 1);
-            out.skipBytes(EncodeConstants.SIZE_OF_BYTE_IN_BYTES);
+            out.skipBytes(Byte.BYTES);
 
             assertEquals(out.readUnsignedShort(), OxmMatchConstants.OPENFLOW_BASIC_CLASS);
             assertEquals(out.readUnsignedByte(), OxmMatchConstants.IPV6_ND_SLL << 1);
-            out.skipBytes(EncodeConstants.SIZE_OF_BYTE_IN_BYTES);
+            out.skipBytes(Byte.BYTES);
 
             assertEquals(out.readUnsignedShort(), OxmMatchConstants.OPENFLOW_BASIC_CLASS);
             assertEquals(out.readUnsignedByte(), OxmMatchConstants.IPV6_ND_TARGET << 1);
-            out.skipBytes(EncodeConstants.SIZE_OF_BYTE_IN_BYTES);
+            out.skipBytes(Byte.BYTES);
 
             assertEquals(out.readUnsignedShort(), OxmMatchConstants.OPENFLOW_BASIC_CLASS);
             assertEquals(out.readUnsignedByte(), OxmMatchConstants.IPV6_ND_TLL << 1);
-            out.skipBytes(EncodeConstants.SIZE_OF_BYTE_IN_BYTES);
+            out.skipBytes(Byte.BYTES);
 
             assertEquals(out.readUnsignedShort(), OxmMatchConstants.OPENFLOW_BASIC_CLASS);
             assertEquals(out.readUnsignedByte(), OxmMatchConstants.IPV6_SRC << 1);
-            out.skipBytes(EncodeConstants.SIZE_OF_BYTE_IN_BYTES);
+            out.skipBytes(Byte.BYTES);
 
             assertEquals(out.readUnsignedShort(), OxmMatchConstants.OPENFLOW_BASIC_CLASS);
             assertEquals(out.readUnsignedByte(), OxmMatchConstants.METADATA << 1);
-            out.skipBytes(EncodeConstants.SIZE_OF_BYTE_IN_BYTES);
+            out.skipBytes(Byte.BYTES);
 
             assertEquals(out.readUnsignedShort(), OxmMatchConstants.OPENFLOW_BASIC_CLASS);
             assertEquals(out.readUnsignedByte(), OxmMatchConstants.MPLS_BOS << 1);
-            out.skipBytes(EncodeConstants.SIZE_OF_BYTE_IN_BYTES);
+            out.skipBytes(Byte.BYTES);
 
             assertEquals(out.readUnsignedShort(), OxmMatchConstants.OPENFLOW_BASIC_CLASS);
             assertEquals(out.readUnsignedByte(), OxmMatchConstants.MPLS_LABEL << 1);
-            out.skipBytes(EncodeConstants.SIZE_OF_BYTE_IN_BYTES);
+            out.skipBytes(Byte.BYTES);
 
             assertEquals(out.readUnsignedShort(), OxmMatchConstants.OPENFLOW_BASIC_CLASS);
             assertEquals(out.readUnsignedByte(), OxmMatchConstants.MPLS_TC << 1);
-            out.skipBytes(EncodeConstants.SIZE_OF_BYTE_IN_BYTES);
+            out.skipBytes(Byte.BYTES);
 
             assertEquals(out.readUnsignedShort(), OxmMatchConstants.OPENFLOW_BASIC_CLASS);
             assertEquals(out.readUnsignedByte(), OxmMatchConstants.PBB_ISID << 1);
-            out.skipBytes(EncodeConstants.SIZE_OF_BYTE_IN_BYTES);
+            out.skipBytes(Byte.BYTES);
 
             assertEquals(out.readUnsignedShort(), OxmMatchConstants.OPENFLOW_BASIC_CLASS);
             assertEquals(out.readUnsignedByte(), OxmMatchConstants.SCTP_DST << 1);
-            out.skipBytes(EncodeConstants.SIZE_OF_BYTE_IN_BYTES);
+            out.skipBytes(Byte.BYTES);
 
             assertEquals(out.readUnsignedShort(), OxmMatchConstants.OPENFLOW_BASIC_CLASS);
             assertEquals(out.readUnsignedByte(), OxmMatchConstants.SCTP_SRC << 1);
-            out.skipBytes(EncodeConstants.SIZE_OF_BYTE_IN_BYTES);
+            out.skipBytes(Byte.BYTES);
 
             assertEquals(out.readUnsignedShort(), OxmMatchConstants.OPENFLOW_BASIC_CLASS);
             assertEquals(out.readUnsignedByte(), OxmMatchConstants.TCP_DST << 1);
-            out.skipBytes(EncodeConstants.SIZE_OF_BYTE_IN_BYTES);
+            out.skipBytes(Byte.BYTES);
 
             assertEquals(out.readUnsignedShort(), OxmMatchConstants.EXPERIMENTER_CLASS);
             assertEquals(out.readUnsignedByte(), EncodeConstants.ONFOXM_ET_TCP_FLAGS << 1);
-            out.skipBytes(EncodeConstants.SIZE_OF_BYTE_IN_BYTES);
+            out.skipBytes(Byte.BYTES);
 
             assertEquals(out.readUnsignedShort(), OxmMatchConstants.OPENFLOW_BASIC_CLASS);
             assertEquals(out.readUnsignedByte() >>> 1, OxmMatchConstants.TCP_SRC);
-            out.skipBytes(EncodeConstants.SIZE_OF_BYTE_IN_BYTES);
+            out.skipBytes(Byte.BYTES);
 
             assertEquals(out.readUnsignedShort(), OxmMatchConstants.OPENFLOW_BASIC_CLASS);
             assertEquals(out.readUnsignedByte(), OxmMatchConstants.TUNNEL_ID << 1);
-            out.skipBytes(EncodeConstants.SIZE_OF_BYTE_IN_BYTES);
+            out.skipBytes(Byte.BYTES);
 
             assertEquals(out.readUnsignedShort(), OxmMatchConstants.OPENFLOW_BASIC_CLASS);
             assertEquals(out.readUnsignedByte(), OxmMatchConstants.UDP_DST << 1);
-            out.skipBytes(EncodeConstants.SIZE_OF_BYTE_IN_BYTES);
+            out.skipBytes(Byte.BYTES);
 
             assertEquals(out.readUnsignedShort(), OxmMatchConstants.OPENFLOW_BASIC_CLASS);
             assertEquals(out.readUnsignedByte(), OxmMatchConstants.UDP_SRC << 1);
-            out.skipBytes(EncodeConstants.SIZE_OF_BYTE_IN_BYTES);
+            out.skipBytes(Byte.BYTES);
 
             assertEquals(out.readUnsignedShort(), OxmMatchConstants.OPENFLOW_BASIC_CLASS);
             assertEquals(out.readUnsignedByte(), OxmMatchConstants.VLAN_PCP << 1);
-            out.skipBytes(EncodeConstants.SIZE_OF_BYTE_IN_BYTES);
+            out.skipBytes(Byte.BYTES);
 
             assertEquals(out.readUnsignedShort(), OxmMatchConstants.OPENFLOW_BASIC_CLASS);
             assertEquals(out.readUnsignedByte(), OxmMatchConstants.VLAN_VID << 1);
-            out.skipBytes(EncodeConstants.SIZE_OF_BYTE_IN_BYTES);
+            out.skipBytes(Byte.BYTES);
         });
     }
 
index 2c02b576de7f9568e62922de2480ef39d62c163c..c6ac7bf526116768a36e8347271908a45b31e3d6 100644 (file)
@@ -14,7 +14,6 @@ import java.util.Optional;
 import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowplugin.api.OFConstants;
 import org.opendaylight.openflowplugin.api.openflow.md.util.OpenflowVersion;
 import org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.action.data.ActionConvertorData;
@@ -158,7 +157,7 @@ public class PacketOutConvertorTest {
         final TransmitPacketInput transmitPacketInput = transmitPacketInputBuilder.build();
 
         Short version = (short) 0x04;
-        byte[] datapathIdByte = new byte[EncodeConstants.SIZE_OF_LONG_IN_BYTES];
+        byte[] datapathIdByte = new byte[Long.BYTES];
         for (int i = 0; i < datapathIdByte.length; i++) {
             datapathIdByte[i] = 1;
         }