@Test public void testEquals() { Dimension dim1 = Dimension.builder().setName("name").setLength(7).build(); Dimension dim2 = new Dimension("name", 7); assertThat(dim1).isEqualTo(dim2);; assertThat(dim1.hashCode()).isEqualTo(dim2.hashCode());; assertThat(dim1).isEqualTo(dim1.toBuilder().build());; assertThat(dim1).isNotEqualTo(Dimension.builder().setName("name").setLength(7).setIsUnlimited(true).build());; assertThat(dim1).isNotEqualTo(Dimension.builder().setName("name").setLength(7).setIsVariableLength(true).build());; }
@Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } Dimension dimension = (Dimension) o; boolean result = isUnlimited == dimension.isUnlimited && isVariableLength == dimension.isVariableLength && isShared == dimension.isShared && Objects.equal(shortName, dimension.shortName); return isUnlimited ? result : result && getLength() == dimension.getLength(); }
Dimension implements Comparable<Dimension> { @Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } Dimension dimension = (Dimension) o; boolean result = isUnlimited == dimension.isUnlimited && isVariableLength == dimension.isVariableLength && isShared == dimension.isShared && Objects.equal(shortName, dimension.shortName); return isUnlimited ? result : result && getLength() == dimension.getLength(); } }
Dimension implements Comparable<Dimension> { @Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } Dimension dimension = (Dimension) o; boolean result = isUnlimited == dimension.isUnlimited && isVariableLength == dimension.isVariableLength && isShared == dimension.isShared && Objects.equal(shortName, dimension.shortName); return isUnlimited ? result : result && getLength() == dimension.getLength(); } Dimension(String name, int length);  Dimension(String name, int length, boolean isShared, boolean isUnlimited, boolean isVariableLength); private  Dimension(Builder builder); }
Dimension implements Comparable<Dimension> { @Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } Dimension dimension = (Dimension) o; boolean result = isUnlimited == dimension.isUnlimited && isVariableLength == dimension.isVariableLength && isShared == dimension.isShared && Objects.equal(shortName, dimension.shortName); return isUnlimited ? result : result && getLength() == dimension.getLength(); } Dimension(String name, int length);  Dimension(String name, int length, boolean isShared, boolean isUnlimited, boolean isVariableLength); private  Dimension(Builder builder); int getLength(); String getShortName(); boolean isUnlimited(); boolean isVariableLength(); boolean isShared(); String makeFullName(Variable v); String makeFullName(Group containingGroup); @Override boolean equals(Object o); @Override int hashCode(); int compareTo(Dimension odim); @Override String toString(); Builder toBuilder(); static Builder builder(); static Builder builder(String name, int length); }
Dimension implements Comparable<Dimension> { @Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } Dimension dimension = (Dimension) o; boolean result = isUnlimited == dimension.isUnlimited && isVariableLength == dimension.isVariableLength && isShared == dimension.isShared && Objects.equal(shortName, dimension.shortName); return isUnlimited ? result : result && getLength() == dimension.getLength(); } Dimension(String name, int length);  Dimension(String name, int length, boolean isShared, boolean isUnlimited, boolean isVariableLength); private  Dimension(Builder builder); int getLength(); String getShortName(); boolean isUnlimited(); boolean isVariableLength(); boolean isShared(); String makeFullName(Variable v); String makeFullName(Group containingGroup); @Override boolean equals(Object o); @Override int hashCode(); int compareTo(Dimension odim); @Override String toString(); Builder toBuilder(); static Builder builder(); static Builder builder(String name, int length); static final Dimension VLEN; }