@Test public void testBuilder() { Attribute att = Attribute.builder().setName("name").setDataType(DataType.FLOAT) .setValues(Array.makeArray(DataType.FLOAT, ImmutableList.of("3.14", ".0015"))).build(); assertThat(att.getName()).isEqualTo("name"); assertThat(att.getShortName()).isEqualTo("name"); assertThat(att.getDataType()).isEqualTo(DataType.FLOAT); assertThat(att.getLength()).isEqualTo(2); assertThat(att.getValue(0)).isEqualTo(Float.parseFloat("3.14")); assertThat(att.getValue(1)).isEqualTo(Float.parseFloat(".0015")); assertThat(att.getNumericValue()).isEqualTo(Float.parseFloat("3.14")); assertThat(att.getNumericValue(0)).isEqualTo(Float.parseFloat("3.14")); assertThat(att.getNumericValue(1)).isEqualTo(Float.parseFloat(".0015")); assertThat(att.isArray()).isTrue(); assertThat(att.isString()).isFalse(); assertThat(att.getStringValue()).isNull(); assertThat(att.getEnumType()).isNull(); }
public static Builder builder() { return new Builder(); }
Attribute { public static Builder builder() { return new Builder(); } }
Attribute { public static Builder builder() { return new Builder(); } Attribute(String name, @Nullable String val);  Attribute(String name, Number val); private  Attribute(Builder builder); }
Attribute { public static Builder builder() { return new Builder(); } Attribute(String name, @Nullable String val);  Attribute(String name, Number val); private  Attribute(Builder builder); static Attribute fromParameter(Parameter param); static Attribute fromArray(String name, ucar.ma2.Array values); static Attribute fromArray(String name, Array<?> values); static Attribute emptyValued(String name, DataType dtype); DataType getDataType(); @Nullable EnumTypedef getEnumType(); int getLength(); String getName(); @Nullable Number getNumericValue(); @Nullable Number getNumericValue(int index); String getShortName(); @Nullable String getStringValue(); @Nullable String getStringValue(int index); @Nullable Object getValue(int index); @Nullable ucar.ma2.Array getValues(); @Nullable ucar.array.Array<?> getArrayValues(); boolean isArray(); boolean isString(); @Override String toString(); @Override boolean equals(Object o); @Override int hashCode(); Builder toBuilder(); static Builder builder(); static Builder builder(String name); }
Attribute { public static Builder builder() { return new Builder(); } Attribute(String name, @Nullable String val);  Attribute(String name, Number val); private  Attribute(Builder builder); static Attribute fromParameter(Parameter param); static Attribute fromArray(String name, ucar.ma2.Array values); static Attribute fromArray(String name, Array<?> values); static Attribute emptyValued(String name, DataType dtype); DataType getDataType(); @Nullable EnumTypedef getEnumType(); int getLength(); String getName(); @Nullable Number getNumericValue(); @Nullable Number getNumericValue(int index); String getShortName(); @Nullable String getStringValue(); @Nullable String getStringValue(int index); @Nullable Object getValue(int index); @Nullable ucar.ma2.Array getValues(); @Nullable ucar.array.Array<?> getArrayValues(); boolean isArray(); boolean isString(); @Override String toString(); @Override boolean equals(Object o); @Override int hashCode(); Builder toBuilder(); static Builder builder(); static Builder builder(String name);  }