Class GenericSetBuilder<T>
java.lang.Object
org.javimmutable.collections.common.GenericSetBuilder<T>
- All Implemented Interfaces:
ISetBuilder<T>
-
Constructor Summary
ConstructorsConstructorDescriptionGenericSetBuilder(IMapBuilder<T, Boolean> mapBuilder, Func1<IMap<T, Boolean>, ISet<T>> setFactory) -
Method Summary
Modifier and TypeMethodDescriptionAdds the specified value to the values included in the collection when build() is called.build()Builds and returns a collection containing all of the added values.clear()Removes all objects and resets the builder to it's initial post-build state.intsize()Determines how many values will be in the collection if build() is called now.
-
Constructor Details
-
GenericSetBuilder
-
-
Method Details
-
build
Description copied from interface:ISetBuilderBuilds and returns a collection containing all of the added values. May be called as often as desired and is safe to call and then continue adding more elements to build another collection with those additional elements.- Specified by:
buildin interfaceISetBuilder<T>- Returns:
- the collection
-
clear
Description copied from interface:ISetBuilderRemoves all objects and resets the builder to it's initial post-build state.- Specified by:
clearin interfaceISetBuilder<T>- Returns:
- the builder (convenience for chaining multiple calls)
-
size
public int size()Description copied from interface:ISetBuilderDetermines how many values will be in the collection if build() is called now.- Specified by:
sizein interfaceISetBuilder<T>
-
add
Description copied from interface:ISetBuilderAdds the specified value to the values included in the collection when build() is called.- Specified by:
addin interfaceISetBuilder<T>- Returns:
- the builder (convenience for chaining multiple calls)
-