public static void appendInstruction(OFFlowMod.Builder fmb,OFInstruction inst){
  List<OFInstruction> newIl=new ArrayList<OFInstruction>();
  List<OFInstruction> oldIl=fmb.getInstructions();
  if (oldIl != null) {
    newIl.addAll(fmb.getInstructions());
  }
  for (  OFInstruction i : newIl) {
    if (i.getType() == inst.getType()) {
      newIl.remove(i);
    }
  }
  newIl.add(inst);
  fmb.setInstructions(newIl);
}

public static void appendInstruction ( OFFlowMod . Builder fmb , OFInstruction inst ) { List < OFInstruction > newIl = new ArrayList < OFInstruction > ( ) ; List < OFInstruction > oldIl = fmb . getInstructions ( ) ; if ( oldIl != null ) { newIl . addAll ( fmb . getInstructions ( ) ) ; } for ( OFInstruction i : newIl ) { if ( i . getType ( ) == inst . getType ( ) ) { newIl . remove ( i ) ; } } newIl . add ( inst ) ; fmb . setInstructions ( newIl ) ; }
adds the instructions to the list of ofinstructions in the offlowmod . any pre - existing instruction of the same type is replaced with ofinstruction inst .
