Skip to content
This repository was archived by the owner on Jun 26, 2026. It is now read-only.

Repository files navigation

jvindicator

Maven Central Maven Central (snapshot) Codecov Java Version

com.io7m.jvindicator

JVM Platform Status
OpenJDK (Temurin) Current Linux Build (OpenJDK (Temurin) Current, Linux)
OpenJDK (Temurin) LTS Linux Build (OpenJDK (Temurin) LTS, Linux)
OpenJDK (Temurin) Current Windows Build (OpenJDK (Temurin) Current, Windows)
OpenJDK (Temurin) LTS Windows Build (OpenJDK (Temurin) LTS, Windows)

Repository Relocation

Development of this project has moved to an open-source but not open-contribution model.

Source code and commits will remain publicly available perpetually, but issues and/or pull requests will be rejected and/or ignored. Additionally, this project will now only be available via a read-only mirror at:

https://codeberg.org/io7m-com/jvindicator

jvindicator

Trivial parameter validation functions intended for use in HTTP servlet applications.

Features

  • Type-safe parameter validation.
  • Written in pure Java 21.
  • OSGi ready.
  • JPMS ready.
  • ISC license.
  • High-coverage automated test suite.

Usage

Use the Vindicator class to build a validator, and then call check(). After calling check(), parameters can be inspected in a type-safe manner:

final var v =
  Vindication.start();
final var p0 =
  v.addRequiredParameter("u0", Vindication.integerUnsigned());
final var p1 =
  v.addRequiredParameter("u1", Vindication.integerUnsignedLong());
final var p2 =
  v.addRequiredParameter("s0", Vindication.integerSigned());
final var p3 =
  v.addRequiredParameter("s1", Vindication.integerSignedLong());
final var p4 =
  v.addRequiredParameter("i0", Vindication.integerBig());

v.check(Map.ofEntries(
  Map.entry("u0", new String[]{"23"}),
  Map.entry("u1", new String[]{"24"}),
  Map.entry("s0", new String[]{"-23"}),
  Map.entry("s1", new String[]{"-24"}),
  Map.entry("i0", new String[]{"-4703919738795935661825"})
));

assertEquals(23, p0.get());
assertEquals(24L, p1.get());
assertEquals(-23, p2.get());
assertEquals(-24L, p3.get());
assertEquals(new BigInteger("-4703919738795935661825"), p4.get());

About

HTTP servlet parameter validation

Topics

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Used by

Contributors

Languages