commons-version

Set of classes to parse and process version information

Лицензия

Лицензия

Категории

Категории

ORM Данные
Группа

Группа

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

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

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

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

1.0.0
Дата

Дата

Тип

Тип

jar
Описание

Описание

commons-version
Set of classes to parse and process version information
Ссылка на сайт

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

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

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

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

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

https://github.com/raydac/commons-version

Скачать commons-version

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

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

Зависимости

test (2)

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

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

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

License Apache 2.0 Java 6.0+ Maven central PayPal donation Yandex.Money donation

What is it?

it is an auxiliary framework to parse and validate some version information.

How it works?

It has two main classes

Usage of version

Version parsed = new Version("idea-1.04.0015-alpha");
Version fullyFromScratch = new Version("idea",new long[]{1,4,15},"alpha");

Version onlyNumber = new Version(1,4,15);
Version changed = onlyNumber.changePrefix("idea").changePostfix("alpha").changeNumeric(0,1,2);

Usage of version validator

Validator supports AND (,) and OR (;) logical operators, where AND has higher priority.
Allowed conditions:

  • = equals
  • < less
  • > great
  • >= great or equals
  • <= less or equals
  • if there is no any operator then it will be recognized as =
VersionValidator validator = new VersionValidator(">idea-1.1.0,<idea-3.0.2;1.1.0,3.0.2;!=0.0.1-dev");
if (validator.isValid(someVersion)){
  System.out.println("Version valid");
}

Also it is possible to implement own expression parser to parse expressions.
NB! Wrong written conditional operator will be recognized as part of the version prefix! Be careful for typo like =>!

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

Версия
1.0.0