941 * </pre></blockquote>
942 *
943 * <p>This is a <a href="./doc-files/ValueBased.html">value-based</a>
944 * class; use of identity-sensitive operations (including reference equality
945 * ({@code ==}), identity hash code, or synchronization) on instances of
946 * {@code Version} may have unpredictable results and should be avoided.
947 * </p>
948 *
949 * @since 9
950 */
951 public static final class Version
952 implements Comparable<Version>
953 {
954 private final List<Integer> version;
955 private final Optional<String> pre;
956 private final Optional<Integer> build;
957 private final Optional<String> optional;
958
959 /*
960 * List of version number components passed to this constructor MUST
961 * be at least unmodifiable (ideally immutable). In the case on an
962 * unmodifiable list, the caller MUST hand the list over to this
963 * constructor and never change the underlying list.
964 */
965 private Version(List<Integer> unmodifiableListOfVersions,
966 Optional<String> pre,
967 Optional<Integer> build,
968 Optional<String> optional)
969 {
970 this.version = unmodifiableListOfVersions;
971 this.pre = pre;
972 this.build = build;
973 this.optional = optional;
974 }
975
976 /**
977 * Parses the given string as a valid
978 * <a href="#verStr">version string</a> containing a
979 * <a href="#verNum">version number</a> followed by pre-release and
980 * build information.
981 *
|
941 * </pre></blockquote>
942 *
943 * <p>This is a <a href="./doc-files/ValueBased.html">value-based</a>
944 * class; use of identity-sensitive operations (including reference equality
945 * ({@code ==}), identity hash code, or synchronization) on instances of
946 * {@code Version} may have unpredictable results and should be avoided.
947 * </p>
948 *
949 * @since 9
950 */
951 public static final class Version
952 implements Comparable<Version>
953 {
954 private final List<Integer> version;
955 private final Optional<String> pre;
956 private final Optional<Integer> build;
957 private final Optional<String> optional;
958
959 /*
960 * List of version number components passed to this constructor MUST
961 * be at least unmodifiable (ideally immutable). In the case of an
962 * unmodifiable list, the caller MUST hand the list over to this
963 * constructor and never change the underlying list.
964 */
965 private Version(List<Integer> unmodifiableListOfVersions,
966 Optional<String> pre,
967 Optional<Integer> build,
968 Optional<String> optional)
969 {
970 this.version = unmodifiableListOfVersions;
971 this.pre = pre;
972 this.build = build;
973 this.optional = optional;
974 }
975
976 /**
977 * Parses the given string as a valid
978 * <a href="#verStr">version string</a> containing a
979 * <a href="#verNum">version number</a> followed by pre-release and
980 * build information.
981 *
|