Class VersionCollectionManipulators

java.lang.Object
com.atlassian.jira.project.version.VersionCollectionManipulators

@ParametersAreNonnullByDefault public class VersionCollectionManipulators extends Object
  • 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 longer Object.equals(Object) original value) after transformation it's passed to a given consumer.
      Type Parameters:
      T - original value type
      T2 - value type after transformation
      Parameters:
      originalValue - original value
      transformer - value transformation
      valueConsumer - object that accepts changed value