@Test public void serialization() { Link link = new Link("src", "dst"); Map<String, String> properties = new HashMap<>(); properties.put("key", "value"); link.setProperties(properties); JsonNode jsonNode = BatfishObjectMapper.mapper().valueToTree(link); assertThat(jsonNode.get("id").asText(), equalTo(Link.getId("src", "dst"))); assertThat(jsonNode.get("srcId").asText(), equalTo("src")); assertThat(jsonNode.get("dstId").asText(), equalTo("dst")); assertThat(jsonNode.get("properties").get("key").asText(), equalTo("value")); }
public static String getId(String srcId, String dstId) { return "link-" + srcId + "-" + dstId; }
Link extends BfObject { public static String getId(String srcId, String dstId) { return "link-" + srcId + "-" + dstId; } }
Link extends BfObject { public static String getId(String srcId, String dstId) { return "link-" + srcId + "-" + dstId; } Link(String srcId, String dstId);  Link(String srcId, String dstId, LinkType type); @JsonCreator  Link(
      @JsonProperty(PROP_ID) String id,
      @JsonProperty(PROP_SRC_ID) String srcId,
      @JsonProperty(PROP_DST_ID) String dstId,
      @JsonProperty(PROP_TYPE) LinkType type); }
Link extends BfObject { public static String getId(String srcId, String dstId) { return "link-" + srcId + "-" + dstId; } Link(String srcId, String dstId);  Link(String srcId, String dstId, LinkType type); @JsonCreator  Link(
      @JsonProperty(PROP_ID) String id,
      @JsonProperty(PROP_SRC_ID) String srcId,
      @JsonProperty(PROP_DST_ID) String dstId,
      @JsonProperty(PROP_TYPE) LinkType type); @JsonProperty(PROP_DST_ID) String getDstId(); static String getId(String srcId, String dstId); @JsonProperty(PROP_SRC_ID) String getSrcId(); @JsonProperty(PROP_TYPE) LinkType getType(); static LinkType interfaceTypesToLinkType(
      InterfaceType iface1type, InterfaceType iface2type); @JsonProperty(PROP_TYPE) void setType(LinkType type); }
Link extends BfObject { public static String getId(String srcId, String dstId) { return "link-" + srcId + "-" + dstId; } Link(String srcId, String dstId);  Link(String srcId, String dstId, LinkType type); @JsonCreator  Link(
      @JsonProperty(PROP_ID) String id,
      @JsonProperty(PROP_SRC_ID) String srcId,
      @JsonProperty(PROP_DST_ID) String dstId,
      @JsonProperty(PROP_TYPE) LinkType type); @JsonProperty(PROP_DST_ID) String getDstId(); static String getId(String srcId, String dstId); @JsonProperty(PROP_SRC_ID) String getSrcId(); @JsonProperty(PROP_TYPE) LinkType getType(); static LinkType interfaceTypesToLinkType(
      InterfaceType iface1type, InterfaceType iface2type); @JsonProperty(PROP_TYPE) void setType(LinkType type);  }