@Test public void testDuplicateDimension() { Dimension dim = new Dimension("dimName", 42); Group.Builder builder = Group.builder().setName("name").addDimension(dim); try { builder.addDimension(dim); fail(); } catch (Exception e) { assertThat(e.getMessage()).contains("Dimension 'dimName' already exists"); } }
public static Builder builder() { return new Builder(); }
Group { public static Builder builder() { return new Builder(); } }
Group { public static Builder builder() { return new Builder(); } private  Group(Builder builder, @Nullable Group parent); }
Group { public static Builder builder() { return new Builder(); } private  Group(Builder builder, @Nullable Group parent); AttributeContainer attributes(); Group commonParent(Group other); @Nullable Attribute findAttribute(String name); String findAttributeString(String attName, String defaultValue); Optional<Dimension> findDimension(String name); @Nullable Dimension findDimension(Dimension dim); @Nullable Dimension findDimensionLocal(String shortName); @Nullable EnumTypedef findEnumeration(String name); @Nullable Group findGroupLocal(String groupShortName); Optional<Group> findGroupNested(String groupShortName); @Nullable Variable findVariableByAttribute(String attName, String attValue); @Nullable Variable findVariableLocal(String varShortName); @Nullable Variable findVariableOrInParent(String varShortName); ImmutableList<Dimension> getDimensions(); ImmutableList<EnumTypedef> getEnumTypedefs(); String getFullName(); ImmutableList<Group> getGroups(); NetcdfFile getNetcdfFile(); @Nullable Group getParentGroup(); String getShortName(); ImmutableList<Variable> getVariables(); boolean isParent(Group other); boolean isRoot(); ImmutableList<Dimension> makeDimensionsList(String dimString); String getNameAndAttributes(); @Override String toString(); @Override boolean equals(Object oo); @Override int hashCode(); Builder toBuilder(); static Builder builder(); }
Group { public static Builder builder() { return new Builder(); } private  Group(Builder builder, @Nullable Group parent); AttributeContainer attributes(); Group commonParent(Group other); @Nullable Attribute findAttribute(String name); String findAttributeString(String attName, String defaultValue); Optional<Dimension> findDimension(String name); @Nullable Dimension findDimension(Dimension dim); @Nullable Dimension findDimensionLocal(String shortName); @Nullable EnumTypedef findEnumeration(String name); @Nullable Group findGroupLocal(String groupShortName); Optional<Group> findGroupNested(String groupShortName); @Nullable Variable findVariableByAttribute(String attName, String attValue); @Nullable Variable findVariableLocal(String varShortName); @Nullable Variable findVariableOrInParent(String varShortName); ImmutableList<Dimension> getDimensions(); ImmutableList<EnumTypedef> getEnumTypedefs(); String getFullName(); ImmutableList<Group> getGroups(); NetcdfFile getNetcdfFile(); @Nullable Group getParentGroup(); String getShortName(); ImmutableList<Variable> getVariables(); boolean isParent(Group other); boolean isRoot(); ImmutableList<Dimension> makeDimensionsList(String dimString); String getNameAndAttributes(); @Override String toString(); @Override boolean equals(Object oo); @Override int hashCode(); Builder toBuilder(); static Builder builder();  }