I - the inner type of the created transforming collection, i.e. the type of the elements contained in the
wrapped/inner collectionO - the outer type of the created transforming collection, i.e. the type of elements appearing to be in the
created collectionpublic class TransformingCollectionBuilder<I,O> extends Object
TransformingCollections, TransformingSets and TransformingLists.
A builder can be obtained by calling forInnerAndOuterType or
forInnerAndOuterTypeUnknown(). The building methods transform... can only be called after
transformations from inner to outer elements and vice versa have been set.
| Modifier and Type | Method and Description |
|---|---|
static <I,O> TransformingCollectionBuilder<I,O> |
forInnerAndOuterType(Class<? super I> innerTypeToken,
Class<? super O> outerTypeToken)
Returns a new builder for the specified inner and outer type.
|
static <I,O> TransformingCollectionBuilder<I,O> |
forInnerAndOuterTypeUnknown()
Returns a new builder for unknown inner and outer types.
|
TransformingCollectionBuilder<I,O> |
toInner(Function<? super O,? extends I> transformToInner)
Sets the transformation from outer to inner elements which will be used by the created collection.
|
TransformingCollectionBuilder<I,O> |
toOuter(Function<? super I,? extends O> transformToOuter)
Sets the transformation from inner to outer elements which will be used by the created collection.
|
TransformingCollection<I,O> |
transformCollection(Collection<I> collection)
Creates a
TransformingCollection which transforms/decorates the specified collection. |
TransformingList<I,O> |
transformList(List<I> list)
Creates a
TransformingList which transforms/decorates the specified list. |
TransformingSet<I,O> |
transformSet(Set<I> set)
Creates a
TransformingSet which transforms/decorates the specified set. |
public static <I,O> TransformingCollectionBuilder<I,O> forInnerAndOuterType(Class<? super I> innerTypeToken, Class<? super O> outerTypeToken)
I - the inner type of the created transforming collection, i.e. the type of the elements contained in the
wrapped/inner collectionO - the outer type of the created transforming collection, i.e. the type of elements appearing to be in
the created collectioninnerTypeToken - the token for the inner typeouterTypeToken - the token for the outer typepublic static <I,O> TransformingCollectionBuilder<I,O> forInnerAndOuterTypeUnknown()
This is equivalent to calling forInnerAndOuterType(Object.class,
Object.class). To obtain a builder for <I, O> you will have to call
TransformingCollectionBuilder.<I, O> forInnerAndOuterTypeUnknown().
I - the inner type of the created transforming collection, i.e. the type of the elements contained in the
wrapped/inner collectionO - the outer type of the created transforming collection, i.e. the type of elements appearing to be in
the created collectionpublic TransformingCollectionBuilder<I,O> toOuter(Function<? super I,? extends O> transformToOuter)
transformToOuter - transforms inner to outer elementspublic TransformingCollectionBuilder<I,O> toInner(Function<? super O,? extends I> transformToInner)
transformToInner - transforms outer to inner elementspublic TransformingCollection<I,O> transformCollection(Collection<I> collection)
TransformingCollection which transforms/decorates the specified collection.collection - the collection to transform; will be the inner collection of the returned transformationTransformingCollectionpublic TransformingSet<I,O> transformSet(Set<I> set)
TransformingSet which transforms/decorates the specified set.set - the set to transform; will be the inner set of the returned transformationTransformingSetpublic TransformingList<I,O> transformList(List<I> list)
TransformingList which transforms/decorates the specified list.list - the list to transform; will be the inner list of the returned transformationTransformingListThis documentation is licensed under CC-BY 4.0, attributed to Nicolai Parlog from CodeFX.