@Test public void testJsonSerialization() { Ip headIp = Ip.parse("1.1.1.1"); Ip tailIp = Ip.parse("2.2.2.2"); BgpSessionProperties bsp = BgpSessionProperties.builder() .setAddressFamilies(EnumSet.allOf(Type.class)) .setRouteExchangeSettings( ImmutableMap.of(Type.IPV4_UNICAST, new RouteExchange(true, false, true))) .setTailAs(1L) .setHeadAs(2L) .setTailIp(tailIp) .setHeadIp(headIp) .setSessionType(SessionType.EBGP_MULTIHOP) .build(); assertThat(BatfishObjectMapper.clone(bsp, BgpSessionProperties.class), equalTo(bsp)); }
public static @Nonnull Builder builder() { return new Builder(); }
BgpSessionProperties { public static @Nonnull Builder builder() { return new Builder(); } }
BgpSessionProperties { public static @Nonnull Builder builder() { return new Builder(); } private  BgpSessionProperties(
      Collection<Type> addressFamilies,
      Map<Type, RouteExchange> routeExchangeSettings,
      long tailAs,
      long headAs,
      Ip tailIp,
      Ip headIp,
      SessionType sessionType,
      ConfedSessionType confedType); }
BgpSessionProperties { public static @Nonnull Builder builder() { return new Builder(); } private  BgpSessionProperties(
      Collection<Type> addressFamilies,
      Map<Type, RouteExchange> routeExchangeSettings,
      long tailAs,
      long headAs,
      Ip tailIp,
      Ip headIp,
      SessionType sessionType,
      ConfedSessionType confedType); static @Nonnull Builder builder(); @JsonIgnore boolean getAdvertiseExternal(); @JsonIgnore boolean getAdvertiseInactive(); @JsonIgnore boolean getAdditionalPaths(); @JsonIgnore boolean isEbgp(); @JsonProperty(PROP_TAIL_AS) long getTailAs(); @JsonProperty(PROP_HEAD_AS) long getHeadAs(); @JsonProperty(PROP_TAIL_IP) @Nonnull Ip getTailIp(); @JsonProperty(PROP_HEAD_IP) @Nonnull Ip getHeadIp(); @JsonProperty(PROP_SESSION_TYPE) SessionType getSessionType(); @JsonProperty(PROP_CONFEDERATION_TYPE) @Nonnull ConfedSessionType getConfedSessionType(); boolean advertiseUnchangedMed(); boolean advertiseUnchangedLocalPref(); @Nonnull @JsonProperty(PROP_ADDRESS_FAMILIES) Set<Type> getAddressFamilies(); @JsonProperty(PROP_ROUTE_EXCHANGE) @Nonnull Map<Type, RouteExchange> getRouteExchangeSettings(); static BgpSessionProperties from(
      BgpPeerConfig initiator,
      BgpPeerConfig listener,
      boolean reverseDirection,
      long initiatorLocalAs,
      long listenerLocalAs,
      ConfedSessionType confedSessionType); @VisibleForTesting static BgpSessionProperties from(
      BgpPeerConfig initiator, BgpPeerConfig listener, boolean reverseDirection); static @Nonnull SessionType getSessionType(BgpPeerConfig initiator); @Override boolean equals(@Nullable Object o); @Override int hashCode(); @Override String toString(); }
BgpSessionProperties { public static @Nonnull Builder builder() { return new Builder(); } private  BgpSessionProperties(
      Collection<Type> addressFamilies,
      Map<Type, RouteExchange> routeExchangeSettings,
      long tailAs,
      long headAs,
      Ip tailIp,
      Ip headIp,
      SessionType sessionType,
      ConfedSessionType confedType); static @Nonnull Builder builder(); @JsonIgnore boolean getAdvertiseExternal(); @JsonIgnore boolean getAdvertiseInactive(); @JsonIgnore boolean getAdditionalPaths(); @JsonIgnore boolean isEbgp(); @JsonProperty(PROP_TAIL_AS) long getTailAs(); @JsonProperty(PROP_HEAD_AS) long getHeadAs(); @JsonProperty(PROP_TAIL_IP) @Nonnull Ip getTailIp(); @JsonProperty(PROP_HEAD_IP) @Nonnull Ip getHeadIp(); @JsonProperty(PROP_SESSION_TYPE) SessionType getSessionType(); @JsonProperty(PROP_CONFEDERATION_TYPE) @Nonnull ConfedSessionType getConfedSessionType(); boolean advertiseUnchangedMed(); boolean advertiseUnchangedLocalPref(); @Nonnull @JsonProperty(PROP_ADDRESS_FAMILIES) Set<Type> getAddressFamilies(); @JsonProperty(PROP_ROUTE_EXCHANGE) @Nonnull Map<Type, RouteExchange> getRouteExchangeSettings(); static BgpSessionProperties from(
      BgpPeerConfig initiator,
      BgpPeerConfig listener,
      boolean reverseDirection,
      long initiatorLocalAs,
      long listenerLocalAs,
      ConfedSessionType confedSessionType); @VisibleForTesting static BgpSessionProperties from(
      BgpPeerConfig initiator, BgpPeerConfig listener, boolean reverseDirection); static @Nonnull SessionType getSessionType(BgpPeerConfig initiator); @Override boolean equals(@Nullable Object o); @Override int hashCode(); @Override String toString();  }