Skip to content

Commit

Permalink
Utf8 and String types supported in StringList√iew.addAll (#559)
Browse files Browse the repository at this point in the history
  • Loading branch information
li-ukumar committed Jul 15, 2024
1 parent 57b085e commit 16fa706
Showing 1 changed file with 6 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,32 +65,12 @@ public boolean add(Utf8 element) {
@Override
public boolean addAll(int index, java.util.Collection<? extends String> c) {
boolean modified = false;
for (String element : c) {
_utf8List.add(index++, new Utf8(element));
modified = true;
}
return modified;
}

/**
* Overloaded method to add all Utf8 elements of a collection at a specific index.
*/
public boolean addAll(int index, java.util.List<? extends Utf8> c) {
boolean modified = false;
for (Utf8 element : c) {
_utf8List.add(index++, element);
modified = true;
}
return modified;
}

/**
* Overloaded method to add all Utf8 elements of a set at a specific index.
*/
public boolean addAll(int index, java.util.Set<? extends Utf8> c) {
boolean modified = false;
for (Utf8 element : c) {
_utf8List.add(index++, element);
for (Object element : c) {
if (element instanceof Utf8) {
_utf8List.add(index++, (Utf8) element);
} else {
_utf8List.add(index++, new Utf8(String.valueOf(element)));
}
modified = true;
}
return modified;
Expand Down

0 comments on commit 16fa706

Please sign in to comment.