\r
import io.netty.buffer.ByteBuf;\r
\r
-import java.util.ArrayList;\r
-import java.util.List;\r
-\r
-import org.opendaylight.openflowjava.protocol.impl.util.EncodeConstants;\r
+import org.opendaylight.openflowjava.protocol.impl.util.ByteBufUtils;\r
+import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;\r
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Ipv4Address;\r
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.IpAddressAction;\r
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.IpAddressActionBuilder;\r
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.actions.grouping.ActionBuilder;\r
import org.opendaylight.yangtools.yang.binding.Augmentation;\r
\r
-import com.google.common.base.Joiner;\r
-\r
/**\r
* @author michal.polkorab\r
*\r
public abstract class OF10AbstractIpAddressActionDeserializer extends AbstractActionDeserializer {\r
\r
@Override\r
- public Action deserialize(ByteBuf input) {\r
+ public Action deserialize(final ByteBuf input) {\r
ActionBuilder builder = new ActionBuilder();\r
input.skipBytes(EncodeConstants.SIZE_OF_SHORT_IN_BYTES);\r
builder.setType(getType());\r
return builder.build();\r
}\r
\r
- private static Augmentation<Action> createNwAddressAugmentationAndPad(ByteBuf input) {\r
+ private static Augmentation<Action> createNwAddressAugmentationAndPad(final ByteBuf input) {\r
IpAddressActionBuilder ipBuilder = new IpAddressActionBuilder();\r
- List<String> groups = new ArrayList<>();\r
- for (int i = 0; i < EncodeConstants.GROUPS_IN_IPV4_ADDRESS; i++) {\r
- groups.add(Short.toString(input.readUnsignedByte()));\r
- }\r
- Joiner joiner = Joiner.on(".");\r
- ipBuilder.setIpAddress(new Ipv4Address(joiner.join(groups)));\r
+ ipBuilder.setIpAddress(new Ipv4Address(ByteBufUtils.readIpv4Address(input)));\r
return ipBuilder.build();\r
}\r
\r