com.artipie.nuget.metadata.Version Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of nuget-adapter Show documentation
Show all versions of nuget-adapter Show documentation
Turns your files/objects into NuGet artifacts
/*
* The MIT License (MIT) Copyright (c) 2020-2023 artipie.com
* https://github.com/artipie/artipie/blob/master/LICENSE.txt
*/
package com.artipie.nuget.metadata;
import java.util.Comparator;
import java.util.Optional;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
/**
* Version of package.
* See Package versioning.
* See Normalized version numbers.
* Comparison of version strings is implemented using SemVer 2.0.0's version precedence rules.
*
* @since 0.1
*/
@SuppressWarnings("PMD.TooManyMethods")
public final class Version implements Comparable, NuspecField {
/**
* RegEx pattern for matching version string.
*
*/
private static final Pattern PATTERN = Pattern.compile(
String.join(
"",
"(?\\d+)\\.(?\\d+)",
"(\\.(?\\d+)(\\.(?\\d+))?)?",
"(-(?
© 2015 - 2025 Weber Informatics LLC | Privacy Policy