@Test public void testEquals() { ValueEdge<Ip, String> edge1 = new ValueEdge<>(Ip.ZERO, Ip.ZERO, "a"); ValueEdge<Ip, String> edge2 = new ValueEdge<>(Ip.ZERO, Ip.ZERO, "b"); ValueEdge<Ip, String> edge3 = new ValueEdge<>(Ip.ZERO, Ip.FIRST_CLASS_A_PRIVATE_IP, "b"); ValueEdge<Ip, String> edge4 = new ValueEdge<>(Ip.FIRST_CLASS_B_PRIVATE_IP, Ip.FIRST_CLASS_A_PRIVATE_IP, "b"); new EqualsTester() .addEqualityGroup(new Object()) .addEqualityGroup(edge1, edge1, new ValueEdge<>(Ip.ZERO, Ip.ZERO, "a")) .addEqualityGroup(edge2) .addEqualityGroup(edge3) .addEqualityGroup(edge4) .testEquals(); }
@Override public boolean equals(@Nullable Object obj) { if (this == obj) { return true; } if (!(obj instanceof ValueEdge)) { return false; } ValueEdge<?, ?> rhs = (ValueEdge<?, ?>) obj; return _source.equals(rhs._source) && _target.equals(rhs._target) && _value.equals(rhs._value); }
ValueEdge { @Override public boolean equals(@Nullable Object obj) { if (this == obj) { return true; } if (!(obj instanceof ValueEdge)) { return false; } ValueEdge<?, ?> rhs = (ValueEdge<?, ?>) obj; return _source.equals(rhs._source) && _target.equals(rhs._target) && _value.equals(rhs._value); } }
ValueEdge { @Override public boolean equals(@Nullable Object obj) { if (this == obj) { return true; } if (!(obj instanceof ValueEdge)) { return false; } ValueEdge<?, ?> rhs = (ValueEdge<?, ?>) obj; return _source.equals(rhs._source) && _target.equals(rhs._target) && _value.equals(rhs._value); } ValueEdge(N source, N target, V value); }
ValueEdge { @Override public boolean equals(@Nullable Object obj) { if (this == obj) { return true; } if (!(obj instanceof ValueEdge)) { return false; } ValueEdge<?, ?> rhs = (ValueEdge<?, ?>) obj; return _source.equals(rhs._source) && _target.equals(rhs._target) && _value.equals(rhs._value); } ValueEdge(N source, N target, V value); @JsonProperty(PROP_SOURCE) @Nonnull N getSource(); @JsonProperty(PROP_TARGET) @Nonnull N getTarget(); @JsonProperty(PROP_VALUE) @Nonnull V getValue(); @Override boolean equals(@Nullable Object obj); @Override int hashCode(); }
ValueEdge { @Override public boolean equals(@Nullable Object obj) { if (this == obj) { return true; } if (!(obj instanceof ValueEdge)) { return false; } ValueEdge<?, ?> rhs = (ValueEdge<?, ?>) obj; return _source.equals(rhs._source) && _target.equals(rhs._target) && _value.equals(rhs._value); } ValueEdge(N source, N target, V value); @JsonProperty(PROP_SOURCE) @Nonnull N getSource(); @JsonProperty(PROP_TARGET) @Nonnull N getTarget(); @JsonProperty(PROP_VALUE) @Nonnull V getValue(); @Override boolean equals(@Nullable Object obj); @Override int hashCode();  }