Class GenericSetBuilder<T>
java.lang.Object
org.javimmutable.collections.common.GenericSetBuilder<T>
- All Implemented Interfaces:
ISetBuilder<T>
-
Constructor Summary
ConstructorDescriptionGenericSetBuilder
(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.int
size()
Determines how many values will be in the collection if build() is called now.
-
Constructor Details
-
GenericSetBuilder
-
-
Method Details
-
build
Description copied from interface:ISetBuilder
Builds 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:
build
in interfaceISetBuilder<T>
- Returns:
- the collection
-
clear
Description copied from interface:ISetBuilder
Removes all objects and resets the builder to it's initial post-build state.- Specified by:
clear
in interfaceISetBuilder<T>
- Returns:
- the builder (convenience for chaining multiple calls)
-
size
public int size()Description copied from interface:ISetBuilder
Determines how many values will be in the collection if build() is called now.- Specified by:
size
in interfaceISetBuilder<T>
-
add
Description copied from interface:ISetBuilder
Adds the specified value to the values included in the collection when build() is called.- Specified by:
add
in interfaceISetBuilder<T>
- Returns:
- the builder (convenience for chaining multiple calls)
-