Ray Milkey

Remove methods deprecated in Drake from L2ModificationInstruction API

Change-Id: I30dbc2e9c590d4bc2bc672e13581dbd1c3b3561b
...@@ -333,20 +333,19 @@ public abstract class L2ModificationInstruction implements Instruction { ...@@ -333,20 +333,19 @@ public abstract class L2ModificationInstruction implements Instruction {
333 this.mplsLabel = mplsLabel; 333 this.mplsLabel = mplsLabel;
334 } 334 }
335 335
336 + public MplsLabel label() {
337 + return mplsLabel;
338 + }
339 +
336 /** 340 /**
337 - * @deprecated in Drake Release. 341 + * Extracts the MPLS label from the instruction.
338 - * @return integer value of label 342 + *
343 + * @return MPLS label
344 + * @deprecated deprecated in 1.5.0 Falcon
339 */ 345 */
340 - // Consider changing return value to MplsLabel
341 - // after deprecation process so that it'll be symmetric to
342 - // MplsCriterion#label()
343 @Deprecated 346 @Deprecated
344 - public Integer label() {
345 - return mplsLabel.toInt();
346 - }
347 -
348 public MplsLabel mplsLabel() { 347 public MplsLabel mplsLabel() {
349 - return mplsLabel; 348 + return label();
350 } 349 }
351 350
352 @Override 351 @Override
......
...@@ -636,7 +636,7 @@ public class InstructionsTest { ...@@ -636,7 +636,7 @@ public class InstructionsTest {
636 checkAndConvert(instruction, 636 checkAndConvert(instruction,
637 Instruction.Type.L2MODIFICATION, 637 Instruction.Type.L2MODIFICATION,
638 L2ModificationInstruction.ModMplsLabelInstruction.class); 638 L2ModificationInstruction.ModMplsLabelInstruction.class);
639 - assertThat(modMplsLabelInstruction.mplsLabel(), is(equalTo(mplsLabel))); 639 + assertThat(modMplsLabelInstruction.label(), is(equalTo(mplsLabel)));
640 assertThat(modMplsLabelInstruction.subtype(), 640 assertThat(modMplsLabelInstruction.subtype(),
641 is(equalTo(L2ModificationInstruction.L2SubType.MPLS_LABEL))); 641 is(equalTo(L2ModificationInstruction.L2SubType.MPLS_LABEL)));
642 } 642 }
......
...@@ -144,7 +144,7 @@ public final class EncodeInstructionCodecHelper { ...@@ -144,7 +144,7 @@ public final class EncodeInstructionCodecHelper {
144 case MPLS_LABEL: 144 case MPLS_LABEL:
145 final L2ModificationInstruction.ModMplsLabelInstruction modMplsLabelInstruction = 145 final L2ModificationInstruction.ModMplsLabelInstruction modMplsLabelInstruction =
146 (L2ModificationInstruction.ModMplsLabelInstruction) instruction; 146 (L2ModificationInstruction.ModMplsLabelInstruction) instruction;
147 - result.put(InstructionCodec.MPLS_LABEL, modMplsLabelInstruction.mplsLabel().toInt()); 147 + result.put(InstructionCodec.MPLS_LABEL, modMplsLabelInstruction.label().toInt());
148 break; 148 break;
149 149
150 case MPLS_PUSH: 150 case MPLS_PUSH:
......
...@@ -251,7 +251,7 @@ public class FlowRuleCodecTest { ...@@ -251,7 +251,7 @@ public class FlowRuleCodecTest {
251 L2ModificationInstruction.L2SubType.MPLS_LABEL.name()); 251 L2ModificationInstruction.L2SubType.MPLS_LABEL.name());
252 assertThat(instruction.type(), is(Instruction.Type.L2MODIFICATION)); 252 assertThat(instruction.type(), is(Instruction.Type.L2MODIFICATION));
253 assertThat(((L2ModificationInstruction.ModMplsLabelInstruction) instruction) 253 assertThat(((L2ModificationInstruction.ModMplsLabelInstruction) instruction)
254 - .mplsLabel().toInt(), 254 + .label().toInt(),
255 is(MplsLabel.MAX_MPLS)); 255 is(MplsLabel.MAX_MPLS));
256 256
257 instruction = getInstruction(Instruction.Type.L2MODIFICATION, 257 instruction = getInstruction(Instruction.Type.L2MODIFICATION,
......
...@@ -428,7 +428,7 @@ public final class InstructionJsonMatcher extends TypeSafeDiagnosingMatcher<Json ...@@ -428,7 +428,7 @@ public final class InstructionJsonMatcher extends TypeSafeDiagnosingMatcher<Json
428 } 428 }
429 429
430 final int jsonLabel = instructionJson.get("label").intValue(); 430 final int jsonLabel = instructionJson.get("label").intValue();
431 - final int label = instructionToMatch.mplsLabel().toInt(); 431 + final int label = instructionToMatch.label().toInt();
432 if (label != jsonLabel) { 432 if (label != jsonLabel) {
433 description.appendText("MPLS label was " + jsonLabel); 433 description.appendText("MPLS label was " + jsonLabel);
434 return false; 434 return false;
......
...@@ -216,7 +216,7 @@ public final class FlowObjectiveCompositionUtil { ...@@ -216,7 +216,7 @@ public final class FlowObjectiveCompositionUtil {
216 } else { 216 } else {
217 return null; 217 return null;
218 } 218 }
219 - } 219 + }
220 default: 220 default:
221 break; 221 break;
222 } 222 }
...@@ -272,7 +272,7 @@ public final class FlowObjectiveCompositionUtil { ...@@ -272,7 +272,7 @@ public final class FlowObjectiveCompositionUtil {
272 case MPLS_LABEL: 272 case MPLS_LABEL:
273 if (criterionMap.containsKey(Criterion.Type.MPLS_LABEL)) { 273 if (criterionMap.containsKey(Criterion.Type.MPLS_LABEL)) {
274 if (((MplsCriterion) criterionMap.get((Criterion.Type.MPLS_LABEL))).label() 274 if (((MplsCriterion) criterionMap.get((Criterion.Type.MPLS_LABEL))).label()
275 - .equals(((L2ModificationInstruction.ModMplsLabelInstruction) l2).mplsLabel())) { 275 + .equals(((L2ModificationInstruction.ModMplsLabelInstruction) l2).label())) {
276 criterionMap.remove(Criterion.Type.ETH_DST); 276 criterionMap.remove(Criterion.Type.ETH_DST);
277 } else { 277 } else {
278 return null; 278 return null;
......
...@@ -698,7 +698,7 @@ public class OFDPA2GroupHandler { ...@@ -698,7 +698,7 @@ public class OFDPA2GroupHandler {
698 } 698 }
699 if (l2ins.subtype() == L2ModificationInstruction.L2SubType.MPLS_LABEL) { 699 if (l2ins.subtype() == L2ModificationInstruction.L2SubType.MPLS_LABEL) {
700 if (innermostLabel == null) { 700 if (innermostLabel == null) {
701 - innermostLabel = ((L2ModificationInstruction.ModMplsLabelInstruction) l2ins).mplsLabel(); 701 + innermostLabel = ((L2ModificationInstruction.ModMplsLabelInstruction) l2ins).label();
702 } 702 }
703 } 703 }
704 } 704 }
......
...@@ -413,7 +413,7 @@ public class FlowModBuilderVer13 extends FlowModBuilder { ...@@ -413,7 +413,7 @@ public class FlowModBuilderVer13 extends FlowModBuilder {
413 case MPLS_LABEL: 413 case MPLS_LABEL:
414 ModMplsLabelInstruction mplsLabel = 414 ModMplsLabelInstruction mplsLabel =
415 (ModMplsLabelInstruction) l2m; 415 (ModMplsLabelInstruction) l2m;
416 - oxm = factory().oxms().mplsLabel(U32.of(mplsLabel.mplsLabel().toInt())); 416 + oxm = factory().oxms().mplsLabel(U32.of(mplsLabel.label().toInt()));
417 break; 417 break;
418 case MPLS_BOS: 418 case MPLS_BOS:
419 ModMplsBosInstruction mplsBos = (ModMplsBosInstruction) l2m; 419 ModMplsBosInstruction mplsBos = (ModMplsBosInstruction) l2m;
......
...@@ -336,7 +336,7 @@ public final class GroupModBuilder { ...@@ -336,7 +336,7 @@ public final class GroupModBuilder {
336 case MPLS_LABEL: 336 case MPLS_LABEL:
337 L2ModificationInstruction.ModMplsLabelInstruction mplsLabel = 337 L2ModificationInstruction.ModMplsLabelInstruction mplsLabel =
338 (L2ModificationInstruction.ModMplsLabelInstruction) l2m; 338 (L2ModificationInstruction.ModMplsLabelInstruction) l2m;
339 - oxm = factory.oxms().mplsLabel(U32.of(mplsLabel.mplsLabel().toInt())); 339 + oxm = factory.oxms().mplsLabel(U32.of(mplsLabel.label().toInt()));
340 break; 340 break;
341 case MPLS_BOS: 341 case MPLS_BOS:
342 L2ModificationInstruction.ModMplsBosInstruction mplsBos = 342 L2ModificationInstruction.ModMplsBosInstruction mplsBos =
......