Class VersionCollectionManipulators
java.lang.Object
com.atlassian.jira.project.version.VersionCollectionManipulators
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <T,T2> void updateValueIfChangedAfterTranformation(T originalValue, Function<T, T2> transformer, Consumer<T2> valueConsumer) Transforms given value with given function.static Function<Collection<Version>, Collection<Version>> versionRemover(Version versionToRemove) Gets a function than in given version collection removes all occurences of versionToRemovestatic Function<Collection<Version>, Collection<Version>> versionReplacer(Version versionToRemove, Version versionToSwap) Gets a function than in given version collection replaces all occurences of versionToRemove with version ToSwap
-
Constructor Details
-
VersionCollectionManipulators
public VersionCollectionManipulators()
-
-
Method Details
-
versionReplacer
public static Function<Collection<Version>,Collection<Version>> versionReplacer(Version versionToRemove, Version versionToSwap) Gets a function than in given version collection replaces all occurences of versionToRemove with version ToSwap- Parameters:
versionToRemove- The version to remove.versionToSwap- The version being swapped in. May be null (in which case nothing gets swapped in).
-
versionRemover
public static Function<Collection<Version>,Collection<Version>> versionRemover(Version versionToRemove) Gets a function than in given version collection removes all occurences of versionToRemove- Parameters:
versionToRemove- The version to remove.
-
updateValueIfChangedAfterTranformation
public static <T,T2> void updateValueIfChangedAfterTranformation(T originalValue, Function<T, T2> transformer, Consumer<T2> valueConsumer) Transforms given value with given function. If value is changed (nullability changed or transformed value no longerObject.equals(Object)original value) after transformation it's passed to a given consumer.- Type Parameters:
T- original value typeT2- value type after transformation- Parameters:
originalValue- original valuetransformer- value transformationvalueConsumer- object that accepts changed value
-