net.amygdalum.util.builders.Arrays Maven / Gradle / Ivy
package net.amygdalum.util.builders;
import java.util.ArrayList;
import java.util.List;
public final class Arrays {
private List base;
private Arrays(List base) {
this.base = base;
}
public static Arrays init(int size) {
return new Arrays(new ArrayList(size));
}
public Arrays add(T item) {
base.add(item);
return this;
}
public Arrays addAll(T[] items) {
for (T item : items) {
base.add(item);
}
return this;
}
public Arrays addAll(List items) {
base.addAll(items);
return this;
}
public T[] build(T[] a) {
return base.toArray(a);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy