@Test public void shouldReturnFalseWhenNotSelfLooped() { final SwitchId srcSwitch = new SwitchId("00:00:00:00:00:00:00:01"); final SwitchId dstSwitch = new SwitchId("00:00:00:00:00:00:00:02"); PathNode source = new PathNode(srcSwitch, 1, 0); PathNode destination = new PathNode(dstSwitch, 2, 1); IslInfoData isl = new IslInfoData(source, destination, IslChangeType.DISCOVERED, false); assertFalse(isl.isSelfLooped()); }
@JsonIgnore public boolean isSelfLooped() { return Objects.equals(source.getSwitchId(), destination.getSwitchId()); }
IslInfoData extends CacheTimeTag { @JsonIgnore public boolean isSelfLooped() { return Objects.equals(source.getSwitchId(), destination.getSwitchId()); } }
IslInfoData extends CacheTimeTag { @JsonIgnore public boolean isSelfLooped() { return Objects.equals(source.getSwitchId(), destination.getSwitchId()); } IslInfoData(IslInfoData that);  IslInfoData(PathNode source, PathNode destination, IslChangeType state, boolean underMaintenance); @Builder(toBuilder = true) @JsonCreator  IslInfoData(@JsonProperty("latency_ns") long latency,
                       @JsonProperty("source") PathNode source,
                       @JsonProperty("destination") PathNode destination,
                       @JsonProperty("speed") long speed,
                       @JsonProperty("available_bandwidth") long availableBandwidth,
                       @JsonProperty("max_bandwidth")  long maxBandwidth,
                       @JsonProperty("default_max_bandwidth") long defaultMaxBandwidth,
                       @JsonProperty("state") IslChangeType state,
                       @JsonProperty("actual_state")  IslChangeType actualState,
                       @JsonProperty("cost") int cost,
                       @JsonProperty("time_create") Long timeCreateMillis,
                       @JsonProperty("time_modify") Long timeModifyMillis,
                       @JsonProperty("under_maintenance") boolean underMaintenance,
                       @JsonProperty("enable_bfd") boolean enableBfd,
                       @JsonProperty("bfd_session_status") String bfdSessionStatus,
                       @JsonProperty("packet_id") Long packetId); }
IslInfoData extends CacheTimeTag { @JsonIgnore public boolean isSelfLooped() { return Objects.equals(source.getSwitchId(), destination.getSwitchId()); } IslInfoData(IslInfoData that);  IslInfoData(PathNode source, PathNode destination, IslChangeType state, boolean underMaintenance); @Builder(toBuilder = true) @JsonCreator  IslInfoData(@JsonProperty("latency_ns") long latency,
                       @JsonProperty("source") PathNode source,
                       @JsonProperty("destination") PathNode destination,
                       @JsonProperty("speed") long speed,
                       @JsonProperty("available_bandwidth") long availableBandwidth,
                       @JsonProperty("max_bandwidth")  long maxBandwidth,
                       @JsonProperty("default_max_bandwidth") long defaultMaxBandwidth,
                       @JsonProperty("state") IslChangeType state,
                       @JsonProperty("actual_state")  IslChangeType actualState,
                       @JsonProperty("cost") int cost,
                       @JsonProperty("time_create") Long timeCreateMillis,
                       @JsonProperty("time_modify") Long timeModifyMillis,
                       @JsonProperty("under_maintenance") boolean underMaintenance,
                       @JsonProperty("enable_bfd") boolean enableBfd,
                       @JsonProperty("bfd_session_status") String bfdSessionStatus,
                       @JsonProperty("packet_id") Long packetId); void setAvailableBandwidth(long availableBandwidth); void setState(IslChangeType state); @JsonIgnore boolean isSelfLooped(); }
IslInfoData extends CacheTimeTag { @JsonIgnore public boolean isSelfLooped() { return Objects.equals(source.getSwitchId(), destination.getSwitchId()); } IslInfoData(IslInfoData that);  IslInfoData(PathNode source, PathNode destination, IslChangeType state, boolean underMaintenance); @Builder(toBuilder = true) @JsonCreator  IslInfoData(@JsonProperty("latency_ns") long latency,
                       @JsonProperty("source") PathNode source,
                       @JsonProperty("destination") PathNode destination,
                       @JsonProperty("speed") long speed,
                       @JsonProperty("available_bandwidth") long availableBandwidth,
                       @JsonProperty("max_bandwidth")  long maxBandwidth,
                       @JsonProperty("default_max_bandwidth") long defaultMaxBandwidth,
                       @JsonProperty("state") IslChangeType state,
                       @JsonProperty("actual_state")  IslChangeType actualState,
                       @JsonProperty("cost") int cost,
                       @JsonProperty("time_create") Long timeCreateMillis,
                       @JsonProperty("time_modify") Long timeModifyMillis,
                       @JsonProperty("under_maintenance") boolean underMaintenance,
                       @JsonProperty("enable_bfd") boolean enableBfd,
                       @JsonProperty("bfd_session_status") String bfdSessionStatus,
                       @JsonProperty("packet_id") Long packetId); void setAvailableBandwidth(long availableBandwidth); void setState(IslChangeType state); @JsonIgnore boolean isSelfLooped();  }