Enum Segment

java.lang.Object
java.lang.Enum<Segment>
org.codehaus.mojo.versions.api.Segment
All Implemented Interfaces:
Serializable, Comparable<Segment>

public enum Segment extends Enum<Segment> implements Comparable<Segment>
Indicates the segment along with its 0-based index
Author:
Andrzej Jarmoniuk
  • Enum Constant Details Link icon

    • MAJOR Link icon

      public static final Segment MAJOR
    • MINOR Link icon

      public static final Segment MINOR
    • INCREMENTAL Link icon

      public static final Segment INCREMENTAL
    • SUBINCREMENTAL Link icon

      public static final Segment SUBINCREMENTAL
  • Method Details Link icon

    • values Link icon

      public static Segment[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      Returns:
      an array containing the constants of this enum type, in the order they are declared
    • valueOf Link icon

      public static Segment valueOf(String name)
      Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum type has no constant with the specified name
      NullPointerException - if the argument is null
    • value Link icon

      public int value()
      Returns the 0-based sendex index
      Returns:
      0-based sendex index
    • of Link icon

      public static Segment of(int index)
    • majorTo Link icon

      public static Segment majorTo(Segment other)
      Creates a segment that has a greater scope than the given segment or null if the segment is already MAJOR
      Parameters:
      other - segment that the new segment is to be based on
      Returns:
      that has a greater scope than the given segment or null if the segment is already MAJOR
    • minorTo Link icon

      public static Segment minorTo(Segment other)
      Creates a segment that has a lesser scope than the given segment
      Parameters:
      other - segment that the new segment is to be based on
      Returns:
      that has a lesser scope than the given segment
    • isMajorTo Link icon

      public boolean isMajorTo(Segment other)
      Returns true if the given segment is more major than the other
      Parameters:
      other - other segment to compare
      Returns:
      true if the given segment is more major
    • toString Link icon

      public String toString()
      Overrides:
      toString in class Enum<Segment>