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

us.bpsm.edn.parser.DefaultSetFactory Maven / Gradle / Ivy

// (c) 2012 B Smith-Mannschott -- Distributed under the Eclipse Public License
package us.bpsm.edn.parser;

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

final class DefaultSetFactory implements CollectionBuilder.Factory {
    public CollectionBuilder builder() {
        return new CollectionBuilder() {
            Set set = new HashSet();
            public void add(Object o) {
                set.add(o);
            }
            public Object build() {
                return Collections.unmodifiableSet(set);
            }
        };
    }
}