Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Readd required method
  • Loading branch information
Ahmed Yarub Hani Al Nuaimi committed Apr 23, 2024
1 parent bf28bc9 commit 057685f
Showing 1 changed file with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,18 @@ public final Builder<T> removeAll(T item) {
return this;
}

@CanIgnoreReturnValue
public final Builder<T> replaceElement(int lineIndex, T with) {
for (int i = 0; i < items.size(); i++) {
if (items.get(i).getLineIndex() == lineIndex) {
items.set(i, new ItemOrTextBlock<>(with, lineIndex));
break;
}
}

return this;
}

@Override
public final ListSection<T> build() {
return new ListSection<>(getSectionKey(), ImmutableList.copyOf(items), firstLineNumber);
Expand Down

0 comments on commit 057685f

Please sign in to comment.