Skip to content

Kaptan Field Checker V1.1.0

Latest
Compare
Choose a tag to compare
@burakim burakim released this 26 Dec 08:50
· 1 commit to master since this release

Kaptan finally supports "MustBeFollowingValues" derived annotations. You can specify an allowed value set for class fields. If it does not get any value in the allowed set, it raised a field value violation exception.

The following annotations were added in this version:

  • MustContainsFollowingByteValues(values={,,..})
  • MustContainsFollowingDoubleValues(values={,,..})
  • MustContainsFollowingFloatValues(values={,,..})
  • MustContainsFollowingIntegerValues(values={,,..})
  • MustContainsFollowingLongValues(values={,,..})
  • MustContainsFollowingShortIntegerValues(values={,,..})
  • MustContainsFollowingStringValues(values={,,..})

Another improvement is the "Violation" model object. In the "FieldViolationException" class, it contained an ArrayList that contains only annotation classes. It sometimes led to ambiguity about which field caused a violation. Now this ArrayList contains "Violation" model object that contains field object that refers guilty class field and annotation to specify what its guilt is.

Finally, Kaptan supports JAVA enumerations too.