@Test public void testToBuilder() { Dimension dim = Dimension.builder().setName("name").setLength(7).setIsUnlimited(true).build(); assertThat(dim.getShortName()).isEqualTo("name"); assertThat(dim.isUnlimited()).isTrue(); Dimension dim2 = dim.toBuilder().setName("name2").build(); assertThat(dim2).isEqualTo(new Dimension("name2", 7, true, true, false)); assertThat(dim.compareTo(dim2)).isEqualTo(-1); assertThat(dim2.compareTo(dim)).isEqualTo(1); assertThat(dim2.compareTo(dim2)).isEqualTo(0); }
public Builder toBuilder() { return builder().setName(this.shortName).setIsUnlimited(this.isUnlimited).setIsVariableLength(this.isVariableLength) .setIsShared(this.isShared).setLength(getLength()); }
Dimension implements Comparable<Dimension> { public Builder toBuilder() { return builder().setName(this.shortName).setIsUnlimited(this.isUnlimited).setIsVariableLength(this.isVariableLength) .setIsShared(this.isShared).setLength(getLength()); } }
Dimension implements Comparable<Dimension> { public Builder toBuilder() { return builder().setName(this.shortName).setIsUnlimited(this.isUnlimited).setIsVariableLength(this.isVariableLength) .setIsShared(this.isShared).setLength(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> { public Builder toBuilder() { return builder().setName(this.shortName).setIsUnlimited(this.isUnlimited).setIsVariableLength(this.isVariableLength) .setIsShared(this.isShared).setLength(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> { public Builder toBuilder() { return builder().setName(this.shortName).setIsUnlimited(this.isUnlimited).setIsVariableLength(this.isVariableLength) .setIsShared(this.isShared).setLength(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; }