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