Version Utility

Provides POJO representations of versions.

Лицензия

Лицензия

Категории

Категории

Utility Универсальные библиотеки
Группа

Группа

com.torchmind.utility
Идентификатор

Идентификатор

version
Последняя версия

Последняя версия

2.0
Дата

Дата

Тип

Тип

jar
Описание

Описание

Version Utility
Provides POJO representations of versions.
Ссылка на сайт

Ссылка на сайт

https://github.com/Torchmind/VersionUtility
Организация-разработчик

Организация-разработчик

Torchmind
Система контроля версий

Система контроля версий

https://github.com/Torchmind/VersionUtility

Скачать version

Как подключить последнюю версию

<!-- https://jarcasting.com/artifacts/com.torchmind.utility/version/ -->
<dependency>
    <groupId>com.torchmind.utility</groupId>
    <artifactId>version</artifactId>
    <version>2.0</version>
</dependency>
// https://jarcasting.com/artifacts/com.torchmind.utility/version/
implementation 'com.torchmind.utility:version:2.0'
// https://jarcasting.com/artifacts/com.torchmind.utility/version/
implementation ("com.torchmind.utility:version:2.0")
'com.torchmind.utility:version:jar:2.0'
<dependency org="com.torchmind.utility" name="version" rev="2.0">
  <artifact name="version" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.torchmind.utility', module='version', version='2.0')
)
libraryDependencies += "com.torchmind.utility" % "version" % "2.0"
[com.torchmind.utility/version "2.0"]

Зависимости

provided (1)

Идентификатор библиотеки Тип Версия
com.github.spotbugs : spotbugs-annotations jar 3.1.1

test (2)

Идентификатор библиотеки Тип Версия
junit : junit jar 4.12
org.mockito : mockito-core jar 2.15.0

Модули Проекта

Данный проект не имеет модулей.

License Maven Central GitHub Release CircleCI

Version Utility

Table of Contents

About

Provides POJO representations for version numbers and ranges.

Contacts

Using

When running maven you may simply add a new dependency along with our repository to your pom.xml:

<dependencies>
  <dependency>
    <groupId>com.torchmind.utility</groupId>
    <artifactId>version</artifactId>
    <version>2.0</version>
  </dependency>
</dependencies>

<!-- Or for unstable releases: -->
<repository>
  <id>sonatype</id>
  <name>Sonatype Open Source Repository</name>
  <url>https://oss.sonatype.org/content/repositories/snapshots</url>
  
  <snapshots>
    <enabled>true</enabled>
  </snapshots>
</repository>

<dependencies>
  <dependency>
    <groupId>com.torchmind.utility</groupId>
    <artifactId>version</artifactId>
    <version>2.1-SNAPSHOT</version>
  </dependency>
</dependencies>

Parsing SemVer based versions:

SemanticVersion version = SemanticVersion.of("1.0-alpha");
SemanticVersion version = SemanticVersion.of("0.1.0");

Comparing versions:

IVersion version1 = ...;
IVersion version2 = ...;

if (version2.isNewerThan(version1)) {
  // Update application or something
}

Creating version ranges

VersionRange<SemanticVersion> range = SemanticVersion.range("(1.0,2.0]");

// OR

SemanticVersion version1 = ...;
SemanticVersion version2 = ...;
VersionRange<SemanticVersion> range = SemanticVersion.range(version1, version2);

Checking range matches:

VersionRange range = ...;
IVersion version = ...;

if (range.matches(version)) {
  // Dependency satisfied or something
}

// OR

VersionRange range = ...;
Set<IVersion> versions = ...;

Set<IVersion> matchingVersions = range.matching(versions);

Note: Developers may develop their own version parsers by implementing the com.torchmind.utility.version.IVersion interface. For an example please refer to com.torchmind.utility.version.semantic.SemanticVersion.

Issues

You encountered problems with the library or have a suggestion? Create an issue!

  1. Make sure your issue has not been fixed in a newer version (check the list of closed issues
  2. Create a new issue from the issues page
  3. Enter your issue's title (something that summarizes your issue) and create a detailed description containing:
    • What is the expected result?
    • What problem occurs?
    • How to reproduce the problem?
    • Crash Log (Please use a Pastebin service)
  4. Click "Submit" and wait for further instructions

Building

  1. Clone this repository via git clone https://github.com/Torchmind/VersionUtility.git or download a zip
  2. Build the modification by running mvn clean install
  3. The resulting jars can be found in api/target, core/target and mapper/target

Contributing

Before you add any major changes to the library you may want to discuss them with us (see Contact) as we may choose to reject your changes for various reasons. All contributions are applied via Pull-Requests. Patches will not be accepted. Also be aware that all of your contributions are made available under the terms of the Apache License 2.0. Please read the Contribution Guidelines for more information.

com.torchmind.utility

Torchmind

Версии библиотеки

Версия
2.0