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

    • MAJOR

      public static final Segment MAJOR
    • MINOR

      public static final Segment MINOR
    • INCREMENTAL

      public static final Segment INCREMENTAL
    • SUBINCREMENTAL

      public static final Segment SUBINCREMENTAL
  • Method Details

    • values

      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

      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

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

      public static Segment of(int index)
    • isMajorTo

      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

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