net.objectlab.kit.collections.DefaultSetBuilder Maven / Gradle / Ivy
/**
*
*/
package net.objectlab.kit.collections;
import java.util.Collection;
import java.util.HashSet;
import java.util.Set;
/**
* @author Benoit Xhenseval
*
*/
public class DefaultSetBuilder implements SetBuilder {
private final Set set = new HashSet();
private final String id;
public DefaultSetBuilder(final String id) {
super();
this.id = id;
}
@Override
public String getId() {
return id;
}
@Override
public void add(final T t) {
set.add(t);
}
@Override
public void addAll(final Collection t) {
set.addAll(t);
}
Set build() {
return new HashSet(set);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy