@Override
 protected MatchField<?> computeNext() {
   while (oxmIterator.hasNext()) {
     OFOxm<?> oxm = oxmIterator.next();
     if (oxm.getMatchField().arePrerequisitesOK(OFMatchV3Ver14.this)) return oxm.getMatchField();
   }
   endOfData();
   return null;
 }
  @Override
  public ExtensionSelector mapOxm(OFOxm<?> oxm) {
    VlanId vlanId;

    if (oxm.getMatchField().equals(MatchField.VLAN_VID)) {
      if (oxm.isMasked()) {
        OFVlanVidMatch vid = ((OFOxmVlanVidMasked) oxm).getValue();
        OFVlanVidMatch mask = ((OFOxmVlanVidMasked) oxm).getMask();

        if (vid.equals(OFVlanVidMatch.ofRawVid((short) 0))) {
          vlanId = VlanId.NONE;
        } else if (vid.equals(OFVlanVidMatch.PRESENT) && mask.equals(OFVlanVidMatch.PRESENT)) {
          vlanId = VlanId.ANY;
        } else {
          vlanId = VlanId.vlanId(vid.getVlan());
        }
      } else {
        OFVlanVidMatch vid = ((OFOxmVlanVid) oxm).getValue();

        if (!vid.isPresentBitSet()) {
          vlanId = VlanId.NONE;
        } else {
          vlanId = VlanId.vlanId(vid.getVlan());
        }
      }
      return new OfdpaMatchVlanVid(vlanId);
    }
    throw new UnsupportedOperationException("Unexpected OXM: " + oxm.toString());
  }