@Test(expected = IllegalArgumentException.class) public void testNotSupportedThenToMatch1() { NatRuleThen then = new NatRuleThenPool("pool"); ReverseStaticNat.thenToMatch(then); }
@VisibleForTesting static NatRuleMatch thenToMatch(NatRuleThen then) { checkArgument( (then instanceof NatRuleThenPrefix) || (then instanceof NatRuleThenPrefixName), "Not supported type of then in static nat: " + then); if (then instanceof NatRuleThenPrefix) { NatRuleThenPrefix thenPrefix = (NatRuleThenPrefix) then; return new NatRuleMatchSrcAddr(thenPrefix.getPrefix()); } NatRuleThenPrefixName thenPrefix = (NatRuleThenPrefixName) then; return new NatRuleMatchSrcAddrName(thenPrefix.getName()); }
ReverseStaticNat { @VisibleForTesting static NatRuleMatch thenToMatch(NatRuleThen then) { checkArgument( (then instanceof NatRuleThenPrefix) || (then instanceof NatRuleThenPrefixName), "Not supported type of then in static nat: " + then); if (then instanceof NatRuleThenPrefix) { NatRuleThenPrefix thenPrefix = (NatRuleThenPrefix) then; return new NatRuleMatchSrcAddr(thenPrefix.getPrefix()); } NatRuleThenPrefixName thenPrefix = (NatRuleThenPrefixName) then; return new NatRuleMatchSrcAddrName(thenPrefix.getName()); } }
ReverseStaticNat { @VisibleForTesting static NatRuleMatch thenToMatch(NatRuleThen then) { checkArgument( (then instanceof NatRuleThenPrefix) || (then instanceof NatRuleThenPrefixName), "Not supported type of then in static nat: " + then); if (then instanceof NatRuleThenPrefix) { NatRuleThenPrefix thenPrefix = (NatRuleThenPrefix) then; return new NatRuleMatchSrcAddr(thenPrefix.getPrefix()); } NatRuleThenPrefixName thenPrefix = (NatRuleThenPrefixName) then; return new NatRuleMatchSrcAddrName(thenPrefix.getName()); }  }
ReverseStaticNat { @VisibleForTesting static NatRuleMatch thenToMatch(NatRuleThen then) { checkArgument( (then instanceof NatRuleThenPrefix) || (then instanceof NatRuleThenPrefixName), "Not supported type of then in static nat: " + then); if (then instanceof NatRuleThenPrefix) { NatRuleThenPrefix thenPrefix = (NatRuleThenPrefix) then; return new NatRuleMatchSrcAddr(thenPrefix.getPrefix()); } NatRuleThenPrefixName thenPrefix = (NatRuleThenPrefixName) then; return new NatRuleMatchSrcAddrName(thenPrefix.getName()); }   }
ReverseStaticNat { @VisibleForTesting static NatRuleMatch thenToMatch(NatRuleThen then) { checkArgument( (then instanceof NatRuleThenPrefix) || (then instanceof NatRuleThenPrefixName), "Not supported type of then in static nat: " + then); if (then instanceof NatRuleThenPrefix) { NatRuleThenPrefix thenPrefix = (NatRuleThenPrefix) then; return new NatRuleMatchSrcAddr(thenPrefix.getPrefix()); } NatRuleThenPrefixName thenPrefix = (NatRuleThenPrefixName) then; return new NatRuleMatchSrcAddrName(thenPrefix.getName()); }    }