Ray Milkey

Remove methods deprecated in Drake from L2ModificationInstruction API

Change-Id: I30dbc2e9c590d4bc2bc672e13581dbd1c3b3561b
......@@ -333,20 +333,19 @@ public abstract class L2ModificationInstruction implements Instruction {
this.mplsLabel = mplsLabel;
}
public MplsLabel label() {
return mplsLabel;
}
/**
* @deprecated in Drake Release.
* @return integer value of label
* Extracts the MPLS label from the instruction.
*
* @return MPLS label
* @deprecated deprecated in 1.5.0 Falcon
*/
// Consider changing return value to MplsLabel
// after deprecation process so that it'll be symmetric to
// MplsCriterion#label()
@Deprecated
public Integer label() {
return mplsLabel.toInt();
}
public MplsLabel mplsLabel() {
return mplsLabel;
return label();
}
@Override
......
......@@ -636,7 +636,7 @@ public class InstructionsTest {
checkAndConvert(instruction,
Instruction.Type.L2MODIFICATION,
L2ModificationInstruction.ModMplsLabelInstruction.class);
assertThat(modMplsLabelInstruction.mplsLabel(), is(equalTo(mplsLabel)));
assertThat(modMplsLabelInstruction.label(), is(equalTo(mplsLabel)));
assertThat(modMplsLabelInstruction.subtype(),
is(equalTo(L2ModificationInstruction.L2SubType.MPLS_LABEL)));
}
......
......@@ -144,7 +144,7 @@ public final class EncodeInstructionCodecHelper {
case MPLS_LABEL:
final L2ModificationInstruction.ModMplsLabelInstruction modMplsLabelInstruction =
(L2ModificationInstruction.ModMplsLabelInstruction) instruction;
result.put(InstructionCodec.MPLS_LABEL, modMplsLabelInstruction.mplsLabel().toInt());
result.put(InstructionCodec.MPLS_LABEL, modMplsLabelInstruction.label().toInt());
break;
case MPLS_PUSH:
......
......@@ -251,7 +251,7 @@ public class FlowRuleCodecTest {
L2ModificationInstruction.L2SubType.MPLS_LABEL.name());
assertThat(instruction.type(), is(Instruction.Type.L2MODIFICATION));
assertThat(((L2ModificationInstruction.ModMplsLabelInstruction) instruction)
.mplsLabel().toInt(),
.label().toInt(),
is(MplsLabel.MAX_MPLS));
instruction = getInstruction(Instruction.Type.L2MODIFICATION,
......
......@@ -428,7 +428,7 @@ public final class InstructionJsonMatcher extends TypeSafeDiagnosingMatcher<Json
}
final int jsonLabel = instructionJson.get("label").intValue();
final int label = instructionToMatch.mplsLabel().toInt();
final int label = instructionToMatch.label().toInt();
if (label != jsonLabel) {
description.appendText("MPLS label was " + jsonLabel);
return false;
......
......@@ -216,7 +216,7 @@ public final class FlowObjectiveCompositionUtil {
} else {
return null;
}
}
}
default:
break;
}
......@@ -272,7 +272,7 @@ public final class FlowObjectiveCompositionUtil {
case MPLS_LABEL:
if (criterionMap.containsKey(Criterion.Type.MPLS_LABEL)) {
if (((MplsCriterion) criterionMap.get((Criterion.Type.MPLS_LABEL))).label()
.equals(((L2ModificationInstruction.ModMplsLabelInstruction) l2).mplsLabel())) {
.equals(((L2ModificationInstruction.ModMplsLabelInstruction) l2).label())) {
criterionMap.remove(Criterion.Type.ETH_DST);
} else {
return null;
......
......@@ -698,7 +698,7 @@ public class OFDPA2GroupHandler {
}
if (l2ins.subtype() == L2ModificationInstruction.L2SubType.MPLS_LABEL) {
if (innermostLabel == null) {
innermostLabel = ((L2ModificationInstruction.ModMplsLabelInstruction) l2ins).mplsLabel();
innermostLabel = ((L2ModificationInstruction.ModMplsLabelInstruction) l2ins).label();
}
}
}
......
......@@ -413,7 +413,7 @@ public class FlowModBuilderVer13 extends FlowModBuilder {
case MPLS_LABEL:
ModMplsLabelInstruction mplsLabel =
(ModMplsLabelInstruction) l2m;
oxm = factory().oxms().mplsLabel(U32.of(mplsLabel.mplsLabel().toInt()));
oxm = factory().oxms().mplsLabel(U32.of(mplsLabel.label().toInt()));
break;
case MPLS_BOS:
ModMplsBosInstruction mplsBos = (ModMplsBosInstruction) l2m;
......
......@@ -336,7 +336,7 @@ public final class GroupModBuilder {
case MPLS_LABEL:
L2ModificationInstruction.ModMplsLabelInstruction mplsLabel =
(L2ModificationInstruction.ModMplsLabelInstruction) l2m;
oxm = factory.oxms().mplsLabel(U32.of(mplsLabel.mplsLabel().toInt()));
oxm = factory.oxms().mplsLabel(U32.of(mplsLabel.label().toInt()));
break;
case MPLS_BOS:
L2ModificationInstruction.ModMplsBosInstruction mplsBos =
......