@Test public void testEquals() { ContinuousResource resource1 = Resources.continuous(D1, P1, Bandwidth.class) .resource(BW1.bps()); ContinuousResource sameAsResource1 = Resources.continuous(D1, P1, Bandwidth.class) .resource(BW1.bps()); new EqualsTester() .addEqualityGroup(resource1, sameAsResource1) .testEquals(); }
@Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null || getClass() != obj.getClass()) { return false; } final ContinuousResource other = (ContinuousResource) obj; return Objects.equals(this.id, other.id) && Objects.equals(this.value, other.value); }
ContinuousResource implements Resource { @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null || getClass() != obj.getClass()) { return false; } final ContinuousResource other = (ContinuousResource) obj; return Objects.equals(this.id, other.id) && Objects.equals(this.value, other.value); } }
ContinuousResource implements Resource { @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null || getClass() != obj.getClass()) { return false; } final ContinuousResource other = (ContinuousResource) obj; return Objects.equals(this.id, other.id) && Objects.equals(this.value, other.value); } ContinuousResource(ContinuousResourceId id, double value);   ContinuousResource(); }
ContinuousResource implements Resource { @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null || getClass() != obj.getClass()) { return false; } final ContinuousResource other = (ContinuousResource) obj; return Objects.equals(this.id, other.id) && Objects.equals(this.value, other.value); } ContinuousResource(ContinuousResourceId id, double value);   ContinuousResource(); @Override ContinuousResourceId id(); @Override String simpleTypeName(); @Override boolean isTypeOf(Class<?> type); double value(); @Override boolean isSubTypeOf(Class<?> ancestor); @Override Optional<T> valueAs(Class<T> type); @Override DiscreteResource child(Object child); @Override ContinuousResource child(Class<?> child, double value); @Override Optional<DiscreteResource> parent(); @Override int hashCode(); @Override boolean equals(Object obj); @Override String toString(); }
ContinuousResource implements Resource { @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null || getClass() != obj.getClass()) { return false; } final ContinuousResource other = (ContinuousResource) obj; return Objects.equals(this.id, other.id) && Objects.equals(this.value, other.value); } ContinuousResource(ContinuousResourceId id, double value);   ContinuousResource(); @Override ContinuousResourceId id(); @Override String simpleTypeName(); @Override boolean isTypeOf(Class<?> type); double value(); @Override boolean isSubTypeOf(Class<?> ancestor); @Override Optional<T> valueAs(Class<T> type); @Override DiscreteResource child(Object child); @Override ContinuousResource child(Class<?> child, double value); @Override Optional<DiscreteResource> parent(); @Override int hashCode(); @Override boolean equals(Object obj); @Override String toString();  }