@Test public void testEvaluate() { Ip tailIp = Ip.parse("2.2.2.2"); BgpSessionProperties sessionProps = BgpSessionProperties.builder() .setHeadAs(11111L) .setTailAs(22222L) .setHeadIp(Ip.parse("1.1.1.1")) .setTailIp(tailIp) .build(); Environment env = Environment.builder(C).setBgpSessionProperties(sessionProps).build(); assertThat(INSTANCE.getNextHopIp(env), equalTo(tailIp)); }
@Nullable @Override public Ip getNextHopIp(Environment environment) { BgpSessionProperties sessionProps = environment.getBgpSessionProperties(); checkState(sessionProps != null, "Expected BGP session properties"); return sessionProps.getTailIp(); }
BgpPeerAddressNextHop extends NextHopExpr { @Nullable @Override public Ip getNextHopIp(Environment environment) { BgpSessionProperties sessionProps = environment.getBgpSessionProperties(); checkState(sessionProps != null, "Expected BGP session properties"); return sessionProps.getTailIp(); } }
BgpPeerAddressNextHop extends NextHopExpr { @Nullable @Override public Ip getNextHopIp(Environment environment) { BgpSessionProperties sessionProps = environment.getBgpSessionProperties(); checkState(sessionProps != null, "Expected BGP session properties"); return sessionProps.getTailIp(); } private  BgpPeerAddressNextHop(); }
BgpPeerAddressNextHop extends NextHopExpr { @Nullable @Override public Ip getNextHopIp(Environment environment) { BgpSessionProperties sessionProps = environment.getBgpSessionProperties(); checkState(sessionProps != null, "Expected BGP session properties"); return sessionProps.getTailIp(); } private  BgpPeerAddressNextHop(); static BgpPeerAddressNextHop getInstance(); @Override boolean equals(Object obj); @Nullable @Override Ip getNextHopIp(Environment environment); @Override int hashCode(); }
BgpPeerAddressNextHop extends NextHopExpr { @Nullable @Override public Ip getNextHopIp(Environment environment) { BgpSessionProperties sessionProps = environment.getBgpSessionProperties(); checkState(sessionProps != null, "Expected BGP session properties"); return sessionProps.getTailIp(); } private  BgpPeerAddressNextHop(); static BgpPeerAddressNextHop getInstance(); @Override boolean equals(Object obj); @Nullable @Override Ip getNextHopIp(Environment environment); @Override int hashCode();  }