name.valery1707:jcommander-validator-number

Validators for numbers

License

License

Categories

Categories

JCommander User Interface CLI
GroupId

GroupId

name.valery1707
ArtifactId

ArtifactId

jcommander-validator-number
Last Version

Last Version

0.1.13
Release Date

Release Date

Type

Type

jar
Description

Description

Validators for numbers

Download jcommander-validator-number

How to add to project

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

Dependencies

compile (1)

Group / Artifact Type Version
name.valery1707 : jcommander-validator-core jar 0.1.13

test (1)

Group / Artifact Type Version
name.valery1707 : jcommander-validator-test jar 0.1.13

Project Modules

There are no modules declared in this project.

Maven Central License

Build Status Coverage Status CodeBeat badge

Waffle.io - Columns and their card count

JCommander is very good command line parsing framework for Java.

"Because life is too short to parse command line parameters" © Cédric Beust

JCommander not only can parse program arguments, it also has an extension point for validation of argument values. At the same time JCommander does not contain (at least in version 1.64) any validators.

This library is designed to correct this omission.

Validators

Some validators is ready to use, but I can't guess all useful cases and many validators designed to be useful after simple extension without any logic implementation.

Example: if you need validate argument value to be within some borders, you need only:

  1. extend class InRange
  2. create default constructor
  3. pass in super constructor required borders
  4. use your class in @Parameter#validateValueWith

Validators list:

  1. Common
    1. Range: InRange, NotInRange
    2. Collection: InCollection
  2. Number
    1. Equal: EqualTo, NotEqualTo
    2. Greater: GreaterThan, GreaterThanOrEqualTo
    3. Less: LessThan, LessThanOrEqualTo
    4. Zero-compare: EqualToZero, NotEqualToZero, GreaterThanZero, GreaterThanOrEqualToZero, LessThanZero, LessThanOrEqualToZero
  3. String
    1. Simple: NotBlank, NotEmpty
    2. Pattern based: PatternContains, PatternNotContains, PatternMatched, PatternNotMatched
  4. IO
    1. Base: Exists, NotExists
    2. File: ExistsFile, ExistsFileReadable, ExistsFileWritable, ExistsFileExecutable
    3. Directory: ExistsDirectory, ExistsDirectoryReadable, ExistsDirectoryWritable, ExistsDirectoryExecutable
  5. NIO
    1. Base: Exists, NotExists
    2. File: ExistsFile, ExistsFileReadable, ExistsFileWritable, ExistsFileExecutable
    3. Directory: ExistsDirectory, ExistsDirectoryReadable, ExistsDirectoryWritable, ExistsDirectoryExecutable
    4. Link: ExistsLink, ExistsLinkReadable, ExistsLinkWritable, ExistsLinkExecutable

Build

Build with code coverage report: clean package jacoco:report

Versions

Version
0.1.13
0.1.11
0.1.10
0.1.9
0.1.8
0.1.7
0.1.6
0.1.5
0.1.4
0.1.3
0.1.2
0.1.1
0.1.0