Package org.anchoranalysis.bean.permute
Class PermutedCopyCreator<T extends AnchorBean<T>>
Object
org.anchoranalysis.bean.permute.PermutedCopyCreator<T>
- Type Parameters:
T- the type of bean which will be copied and permuted.
public class PermutedCopyCreator<T extends AnchorBean<T>> extends Object
Applies a
PermuteProperty to a bean to create new duplicated beans each with different
permuted values.- Author:
- Owen Feehan
-
Constructor Summary
Constructors Constructor Description PermutedCopyCreator(Function<T,String> nameGetter, BiConsumer<T,String> nameSetter) -
Method Summary
Modifier and Type Method Description <S> List<T>createPermutedCopies(List<T> beans, PermuteProperty<S> propertyToPermute, PermutationAssigner setter)Applies a permutation to a copy of each element in a list of beans, updating the custom name of each bean to reflect the permutation.
-
Constructor Details
-
Method Details
-
createPermutedCopies
public <S> List<T> createPermutedCopies(List<T> beans, PermuteProperty<S> propertyToPermute, PermutationAssigner setter) throws CreateExceptionApplies a permutation to a copy of each element in a list of beans, updating the custom name of each bean to reflect the permutation.Specifically,
.XXXis appended to each name, whereXXXdescribes the permutation.- Type Parameters:
S- permutation-type- Parameters:
beans- list of beans on which a permutation is applied.propertyToPermute- the property to permute, and all the values for the permutation.setter- for setting the permutation onto the property.- Returns:
- a list containing the permuted beans.
- Throws:
CreateException- if something goes wrong.
-