io.fabric8.kubernetes.api.builder.BaseFluent Maven / Gradle / Ivy
package io.fabric8.kubernetes.api.builder;
import java.util.List;
import java.util.List;
import java.util.Set;
import java.util.ArrayList;
import java.util.LinkedHashSet;
import java.util.ArrayList;
import java.util.LinkedHashSet;
public class BaseFluent implements Fluent, Visitable{
public final List _visitables = new ArrayList();
public ArrayList build( List extends Builder> list){
ArrayList r = new ArrayList<>();
for (Builder b : list) {
r.add(b.build());
}
return r;
}
public LinkedHashSet build( LinkedHashSet extends Builder> set){
LinkedHashSet r = new LinkedHashSet<>();
for (Builder b : set) {
r.add(b.build());
}
return r;
}
public ArrayList aggregate( List extends T> ...lists){
ArrayList result = new ArrayList<>();
for (List extends T> list : lists) {
result.addAll(list);
}
return result;
}
public LinkedHashSet aggregate( Set extends T> ...sets){
LinkedHashSet result = new LinkedHashSet<>();
for (Set extends T> set : sets) {
result.addAll(set);
}
return result;
}
public T accept( Visitor visitor){
for (Visitable v : _visitables) {
v.accept(visitor);
}
try {
visitor.visit(this);
} catch (ClassCastException e) {
//ignore
}
return (T) this;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy