@Test public void testConstructor() { Ip4Prefix prefix = Ip4Prefix.valueOf("1.2.3.0/24"); Ip4Address nextHop = Ip4Address.valueOf("5.6.7.8"); RouteEntry routeEntry = new RouteEntry(prefix, nextHop); assertThat(routeEntry.toString(), is("RouteEntry{prefix=1.2.3.0/24, nextHop=5.6.7.8}")); Ip6Prefix prefix6 = Ip6Prefix.valueOf("1000::/64"); Ip6Address nextHop6 = Ip6Address.valueOf("2000::1"); RouteEntry routeEntry6 = new RouteEntry(prefix6, nextHop6); assertThat(routeEntry6.toString(), is("RouteEntry{prefix=1000::/64, nextHop=2000::1}")); }
@Override public String toString() { return MoreObjects.toStringHelper(getClass()) .add("prefix", prefix) .add("nextHop", nextHop) .toString(); }
RouteEntry { @Override public String toString() { return MoreObjects.toStringHelper(getClass()) .add("prefix", prefix) .add("nextHop", nextHop) .toString(); } }
RouteEntry { @Override public String toString() { return MoreObjects.toStringHelper(getClass()) .add("prefix", prefix) .add("nextHop", nextHop) .toString(); } RouteEntry(IpPrefix prefix, IpAddress nextHop); }
RouteEntry { @Override public String toString() { return MoreObjects.toStringHelper(getClass()) .add("prefix", prefix) .add("nextHop", nextHop) .toString(); } RouteEntry(IpPrefix prefix, IpAddress nextHop); IpAddress.Version version(); boolean isIp4(); boolean isIp6(); IpPrefix prefix(); IpAddress nextHop(); static String createBinaryString(IpPrefix ipPrefix); @Override boolean equals(Object other); @Override int hashCode(); @Override String toString(); }
RouteEntry { @Override public String toString() { return MoreObjects.toStringHelper(getClass()) .add("prefix", prefix) .add("nextHop", nextHop) .toString(); } RouteEntry(IpPrefix prefix, IpAddress nextHop); IpAddress.Version version(); boolean isIp4(); boolean isIp6(); IpPrefix prefix(); IpAddress nextHop(); static String createBinaryString(IpPrefix ipPrefix); @Override boolean equals(Object other); @Override int hashCode(); @Override String toString();  }