Add StructuredItem#emptyArray (#3915)

This commit is contained in:
RK_01 2024-06-07 22:34:45 +02:00 committed by GitHub
parent 1e244a126d
commit c07adfddb2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -46,6 +46,14 @@ public class StructuredItem implements Item {
return new StructuredItem(0, 0);
}
public static StructuredItem[] emptyArray(final int size) {
final StructuredItem[] items = new StructuredItem[size];
for (int i = 0; i < items.length; i++) {
items[i] = empty();
}
return items;
}
@Override
public int identifier() {
return identifier;
@ -112,4 +120,4 @@ public class StructuredItem implements Item {
", amount=" + amount +
'}';
}
}
}