Class SegmentUtils

java.lang.Object
org.codehaus.mojo.versions.utils.SegmentUtils

public class SegmentUtils extends Object
Utility class for manipulating with Segment objects
  • Constructor Details

    • SegmentUtils

      public SegmentUtils()
  • Method Details

    • determineUnchangedSegment

      public static Optional<Segment> determineUnchangedSegment(boolean allowMajorUpdates, boolean allowMinorUpdates, boolean allowIncrementalUpdates, org.apache.maven.plugin.logging.Log log)

      Based on the passed flags, determines which segment which is not to be changed.

      Also, logs the enriched values of the allowMajorUpdates, allowMinorUpdates, and allowIncrementalUpdates options so that allowMinorUpdates equal to false implies that allowMajorUpdates is also false.

      Also, allowIncrementalUpdates equal to false implies that both allowMajorUpdates and allowMinorUpdates are also false.

      Effective values for update options
      allowMajorUpdatesallowMinorUpdatesallowIncrementalUpdates
      truetruetrue
      truetrue
      true
      Parameters:
      allowMajorUpdates - whether all updates should be allowed
      allowMinorUpdates - if major updates are disallowed, minor, incremental updates should be allowed
      allowIncrementalUpdates - if major and minor updates are disallowed, incremental updates are allowed
      log - If not null, the Log object to log the selected scope
      Returns:
      Returns the segment (0-based) that is unchangeable. If any segment can change, returns -1.