All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.commercehub.gradle.plugin.avro.SetBuilder Maven / Gradle / Ivy

package com.commercehub.gradle.plugin.avro;

import java.util.Collection;
import java.util.Collections;
import java.util.HashSet;
import java.util.Set;

class SetBuilder {
    private Set set = new HashSet();

    SetBuilder add(T e) {
        set.add(e);
        return this;
    }

    final SetBuilder addAll(T... c) {
        Collections.addAll(set, c);
        return this;
    }

    SetBuilder addAll(Collection c) {
        set.addAll(c);
        return this;
    }

    SetBuilder remove(T e) {
        set.remove(e);
        return this;
    }

    Set build() {
        return set;
    }

    static  Set build(T... c) {
        return new SetBuilder().addAll(c).build();
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy