@Test public void testNonEquality() { BgpRouteEntry bgpRouteEntry1 = generateBgpRouteEntry(); Ip4Prefix prefix = Ip4Prefix.valueOf("1.2.3.0/24"); Ip4Address nextHop = Ip4Address.valueOf("5.6.7.8"); byte origin = BgpConstants.Update.Origin.IGP; ArrayList<BgpRouteEntry.PathSegment> pathSegments = new ArrayList<>(); byte pathSegmentType1 = (byte) BgpConstants.Update.AsPath.AS_SEQUENCE; ArrayList<Long> segmentAsNumbers1 = new ArrayList<>(); segmentAsNumbers1.add(1L); segmentAsNumbers1.add(2L); segmentAsNumbers1.add(3L); BgpRouteEntry.PathSegment pathSegment1 = new BgpRouteEntry.PathSegment(pathSegmentType1, segmentAsNumbers1); pathSegments.add(pathSegment1); byte pathSegmentType2 = (byte) BgpConstants.Update.AsPath.AS_SET; ArrayList<Long> segmentAsNumbers2 = new ArrayList<>(); segmentAsNumbers2.add(4L); segmentAsNumbers2.add(5L); segmentAsNumbers2.add(6L); BgpRouteEntry.PathSegment pathSegment2 = new BgpRouteEntry.PathSegment(pathSegmentType2, segmentAsNumbers2); pathSegments.add(pathSegment2); BgpRouteEntry.AsPath asPath = new BgpRouteEntry.AsPath(pathSegments); long localPref = 500; long multiExitDisc = 20; BgpRouteEntry bgpRouteEntry2 = new BgpRouteEntry(bgpSession, prefix, nextHop, origin, asPath, localPref); bgpRouteEntry2.setMultiExitDisc(multiExitDisc); assertThat(bgpRouteEntry1, Matchers.is(not(bgpRouteEntry2))); }
void setMultiExitDisc(long multiExitDisc) { this.multiExitDisc = multiExitDisc; }
BgpRouteEntry extends RouteEntry { void setMultiExitDisc(long multiExitDisc) { this.multiExitDisc = multiExitDisc; } }
BgpRouteEntry extends RouteEntry { void setMultiExitDisc(long multiExitDisc) { this.multiExitDisc = multiExitDisc; } BgpRouteEntry(BgpSession bgpSession, IpPrefix prefix,
                         IpAddress nextHop, byte origin,
                         BgpRouteEntry.AsPath asPath, long localPref); }
BgpRouteEntry extends RouteEntry { void setMultiExitDisc(long multiExitDisc) { this.multiExitDisc = multiExitDisc; } BgpRouteEntry(BgpSession bgpSession, IpPrefix prefix,
                         IpAddress nextHop, byte origin,
                         BgpRouteEntry.AsPath asPath, long localPref); BgpSession getBgpSession(); byte getOrigin(); BgpRouteEntry.AsPath getAsPath(); long getLocalPref(); long getMultiExitDisc(); @Override boolean equals(Object other); @Override int hashCode(); @Override String toString(); }
BgpRouteEntry extends RouteEntry { void setMultiExitDisc(long multiExitDisc) { this.multiExitDisc = multiExitDisc; } BgpRouteEntry(BgpSession bgpSession, IpPrefix prefix,
                         IpAddress nextHop, byte origin,
                         BgpRouteEntry.AsPath asPath, long localPref); BgpSession getBgpSession(); byte getOrigin(); BgpRouteEntry.AsPath getAsPath(); long getLocalPref(); long getMultiExitDisc(); @Override boolean equals(Object other); @Override int hashCode(); @Override String toString();  }