Skip to content

Commit 07b02c5

Browse files
committed
rename attributes.add to set
1 parent baeffa9 commit 07b02c5

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

src/main/java/dev/zarr/zarrjava/core/Attributes.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public Attributes(Map<String, Object> attributes) {
2424
super(attributes);
2525
}
2626

27-
public Attributes add(String s, Object o){
27+
public Attributes set(String s, Object o){
2828
this.put(s, o);
2929
return this;
3030
}

src/test/java/dev/zarr/zarrjava/ZarrV2Test.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ public void testSetAndUpdateAttributes() throws IOException, ZarrException {
288288
.withShape(10, 10)
289289
.withDataType(DataType.UINT8)
290290
.withChunks(5, 5)
291-
.withAttributes(new Attributes(b -> b.add("some", "value")))
291+
.withAttributes(new Attributes(b -> b.set("some", "value")))
292292
.build();
293293

294294
Array array = Array.create(storeHandle, arrayMetadata);
@@ -299,7 +299,7 @@ public void testSetAndUpdateAttributes() throws IOException, ZarrException {
299299
Assertions.assertNull(array.metadata().attributes().get("some"));
300300

301301
// add attribute
302-
array = array.updateAttributes(b -> b.add("new_attribute", "new_value"));
302+
array = array.updateAttributes(b -> b.set("new_attribute", "new_value"));
303303
Assertions.assertEquals("new_value", array.metadata().attributes().getString("new_attribute"));
304304
array = Array.open(storeHandle);
305305
Assertions.assertEquals("new_value", array.metadata().attributes().getString("new_attribute"));

src/test/java/dev/zarr/zarrjava/ZarrV3Test.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -602,7 +602,7 @@ public void testSetAndUpdateAttributes() throws IOException, ZarrException {
602602
.withShape(10, 10)
603603
.withDataType(DataType.UINT8)
604604
.withChunkShape(5, 5)
605-
.withAttributes(new Attributes(b -> b.add("some", "value")))
605+
.withAttributes(new Attributes(b -> b.set("some", "value")))
606606
.build();
607607

608608
Array array = Array.create(storeHandle, arrayMetadata);
@@ -613,7 +613,7 @@ public void testSetAndUpdateAttributes() throws IOException, ZarrException {
613613
Assertions.assertNull(array.metadata().attributes().get("some"));
614614

615615
// add attribute
616-
array = array.updateAttributes(b -> b.add("new_attribute", "new_value"));
616+
array = array.updateAttributes(b -> b.set("new_attribute", "new_value"));
617617
Assertions.assertEquals("new_value", array.metadata().attributes().getString("new_attribute"));
618618
array = Array.open(storeHandle);
619619
Assertions.assertEquals("new_value", array.metadata().attributes().getString("new_attribute"));

0 commit comments

Comments
 (0)