@Test public void testToString() { BgpRouteEntry bgpRouteEntry = generateBgpRouteEntry(); String expectedString = "BgpRouteEntry{prefix=1.2.3.0/24, nextHop=5.6.7.8, " + "bgpId=10.0.0.1, origin=IGP, asPath=AsPath{pathSegments=" + "[PathSegment{type=AS_SEQUENCE, segmentAsNumbers=[1, 2, 3]}, " + "PathSegment{type=AS_SET, segmentAsNumbers=[4, 5, 6]}]}, " + "localPref=100, multiExitDisc=20}"; assertThat(bgpRouteEntry.toString(), is(expectedString)); }
@Override public String toString() { return MoreObjects.toStringHelper(getClass()) .add("prefix", prefix()) .add("nextHop", nextHop()) .add("bgpId", bgpSession.remoteInfo().bgpId()) .add("origin", BgpConstants.Update.Origin.typeToString(origin)) .add("asPath", asPath) .add("localPref", localPref) .add("multiExitDisc", multiExitDisc) .toString(); }
BgpRouteEntry extends RouteEntry { @Override public String toString() { return MoreObjects.toStringHelper(getClass()) .add("prefix", prefix()) .add("nextHop", nextHop()) .add("bgpId", bgpSession.remoteInfo().bgpId()) .add("origin", BgpConstants.Update.Origin.typeToString(origin)) .add("asPath", asPath) .add("localPref", localPref) .add("multiExitDisc", multiExitDisc) .toString(); } }
BgpRouteEntry extends RouteEntry { @Override public String toString() { return MoreObjects.toStringHelper(getClass()) .add("prefix", prefix()) .add("nextHop", nextHop()) .add("bgpId", bgpSession.remoteInfo().bgpId()) .add("origin", BgpConstants.Update.Origin.typeToString(origin)) .add("asPath", asPath) .add("localPref", localPref) .add("multiExitDisc", multiExitDisc) .toString(); } BgpRouteEntry(BgpSession bgpSession, IpPrefix prefix,
                         IpAddress nextHop, byte origin,
                         BgpRouteEntry.AsPath asPath, long localPref); }
BgpRouteEntry extends RouteEntry { @Override public String toString() { return MoreObjects.toStringHelper(getClass()) .add("prefix", prefix()) .add("nextHop", nextHop()) .add("bgpId", bgpSession.remoteInfo().bgpId()) .add("origin", BgpConstants.Update.Origin.typeToString(origin)) .add("asPath", asPath) .add("localPref", localPref) .add("multiExitDisc", multiExitDisc) .toString(); } 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 { @Override public String toString() { return MoreObjects.toStringHelper(getClass()) .add("prefix", prefix()) .add("nextHop", nextHop()) .add("bgpId", bgpSession.remoteInfo().bgpId()) .add("origin", BgpConstants.Update.Origin.typeToString(origin)) .add("asPath", asPath) .add("localPref", localPref) .add("multiExitDisc", multiExitDisc) .toString(); } 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();  }