Minor updates involving cosmetic changes have been omitted from this list.
See https://github.com/cowwoc/requirements.java/commits/main for a full list.
- Added
StringValidator.matches(Pattern)
.
- Added
PathValidator.contains(Path)
.
- Escape linefeed characters in diffs.
- Improvements
- When referencing to a variable number of elements, always use the plural form of a type (e.g.
actual must contain X entries
even ifX
is one). - Added special handling for
Collection.contains(Object)
throwingNullPointerException
because the collection does not permit null elements.
- When referencing to a variable number of elements, always use the plural form of a type (e.g.
- Breaking changes:
- The module and package names now contain the major version number of the library, per: https://www.reddit.com/r/java/comments/1dxbag2/comment/lc63gz1/
- Parameter names may not contain whitespace (previously only leading or trailing whitespace was disallowed).
- Removed ability to configure validators in order to simplify API.
- Reduced the library scope by removing all type-conversion methods, such as
asString()
orasList()
. - Removed
UrlValidator
. - Replaced
assumeThat()
withassert that()
. - Moved
com.github.cowwoc.requirements10.java.terminal.TerminalEncoding
tocom.github.cowwoc.requirements10.java.TerminalEncoding
. - Added
GenericType
to represent types with type parameters.ClassValidator
was replaced byGenericTypeValidator
. - Replaced
Validator.elseGetMessages()
withValidator.getFailures().getMessages()
. - Replaced
Validator.elseGetException()
withValidator.getFailures().getException()
. - Renamed
Validator.isSameReferenceAs()
toisReferenceEqualTo()
,Validator.isNotSameReferenceAs()
toisReferenceNotEqualTo()
. - Removed
CollectionValidator.containsSameNullity()
yet again due to poor usability.
- New features:
- Added
GenericTypeValidator.isPrimitive()
. - Added
validationFailed()
andgetValueOrDefault()
to all validators. - Added
StringValidator.doesNotContainWhitespace()
.
- Added
- Improvements
- If
checkIf()
cannot run validations due to a null value, the expected conditions are still reported.
- If
- Breaking changes:
- The library now requires JDK 21.
- Added a
jackson
module to validateJsonNode
. - Removed the Maven plugin and code generator.
- The code generator was causing a "split package" issue because it was generating code into the same package in all dependent libraries.
- This caused a “split package” error since only one module is allowed to export a package.
- Removed the use of native binaries. Colored DIFFs are still supported, but Windows requires the use of Windows Terminal (free download in Windows 10, built-in feature in Windows 11).
- Replaced
validateThat()
withcheckIf()
. - Replaced
assertThat()
withassert assumeThat().elseThrow()
. - Added support for the built-in
assert
mechanism.- Asserts can be used with any type of validator, but are typically used
with
assumeThat().orElseThrow()
andcheckIf().orElseThrow()
.
- Asserts can be used with any type of validator, but are typically used
with
- Use consistent parameter ordering across the entire API:
(value, name)
- Adding contextual information now looks like this:
requireThat().withContext(value, name)
- Adding contextual information now looks like this:
- Added
Validator.apply(Consumer)
to nest validations, andValidator.and(Validator)
to combine validation results. - Renamed
Validator.getActual()
togetValue()
. - Replaced
isBetweenClosed(min, max)
withisBetween(min, true, max, true)
. - Renamed
StringValidator.isInteger()
toasPrimitiveInteger()
andisCharacter()
toasPrimitiveCharacter()
. - Improved performance by reducing memory allocation and the frequency of GC runs.
- Added support for primitive types to avoid boxing when possible.
- Dropped the
isOneOf()
andisNotOneOf()
functionality yet again. I haven't figured out a good design for this yet. - Added
ObjectValidator.isX()
methods to downcast to known types. - Replaced thread context with
Validators.getContext()
,withContext()
,removeContext()
. - Added
StringValidator.matches(regex)
.
- Bugfixes:
StringValidator/Verifier.asShort()
,asInteger()
andasLong()
were not handling the case where a string could not be converted to a number.- Validators were only returning the first failure.
- Improvements:
- Added
CollectionValidator/Verifier.doesNotContainMixedNulls()
.
- Added
- Improvements:
- Added
StringValidator/Verifier.asShort()
,asInteger()
,asLong()
andasBigDecimal()
. - Removed unused imports in the generated API files.
- Added
- Skipped due to deployment error
- Bugfixes
StringValidator.length(l -> l.isBetweenClosed(min, max))
was not throwing an exception on failure.
- No changes (deployed by mistake)
- Bugfixes
Configuration.toString(Map)
did not print out the correct values.- The
lock
field of optimized exceptions is nowtransient
.
- Improvements:
cleanStackTrace
no longer strip public library methods that invoke user code (e.g.assertThat
).
- Improvements:
- Added
StringValidator/Verifier.strip()
andisStripped()
. - Added
@CheckReturnValue
toObjectValidator/Verifier.getActual()
.
- Added
- Improvements:
- Replaced use of
synchronized
keyword withStampedLock
to improve compatibility with virtual threads.
- Replaced use of
- Improvements:
- Instantiate exceptions 3% faster by using
LambdaMetafactory
instead ofMethodHandle.invokeExact()
. - Updated list of 3rd-party licenses.
- Updated look of documentation on Github (minor formatting changes).
- Instantiate exceptions 3% faster by using
- Breaking changes:
- Replaced
Requirements.assertThat(actual, name)
byassertThat(requirements -> requirements.requireThat(actual, name))
andassertThatAndReturn(requirements -> requirements.requireThat(actual, name))
. The latter is used for assertions with a return value. This change improves the runtime performance ofassertThat()
and reduces code duplication across the library. - Replaced
ThreadRequirements.getContextMessage()
byDefaultRequirements.getContextMessage()
. - Removed
Object.isActualAvailable()
in favor ofRequirements.assertionsAreEnabled()
.
- Replaced
- Bugfixes:
DefaultRequirements
was not thread-safe.
- Improvements
- Added
Configuration
-related methods (except forwithoutContext()
andwithoutAnyContext()
which wouldn't have any effect) toDefaultRequirements
.
- Added
- Improvements
- Updated dependencies
- Improvements
- Added support for
aarch64
architecture. Native libraries are not available at this time.
- Added support for
- Improvements
AbstractObjectVerifier.validator
is now final.- Optimized common case where
validationResult()
returnsthis
.
- Bugfix: Fixed regression that prevented ThreadRequirements from being thread-safe.
- Breaking changes
- Removed thread-safety from most classes for performance-reasons. It seems like single-threaded usage is far more common.
- Removed deprecated methods
Configuration.putContext()
,Configuration.removeContext()
that were replaced byConfiguration.withContext()
andConfiguration.withoutContext()
, respectively. - Removed deprecated methods
ThreadRequirements.putContext()
,ThreadRequirements.removeContext()
,ThreadRequirements.removeAllContext()
that were replaced byThreadRequirements.withContext()
,ThreadRequirements.withoutContext()
andThreadRequirements.withoutAnyContext()
, respectively.
- Improvements
- Added default string converter for
Set
,Map
andThrowable
. ArrayValidator
: avoid converting array into a list until absolutely necessary.- Added
Configuration.getContextMessage()
andThreadRequirements.getContextMessage()
. - Added
Configuration.copy()
. - Added
Configuration.withoutAnyContext()
.
- Added default string converter for
- New Features
- Added
StringValidator
/Verifier.asBoolean()
. - Added
StringValidator/StringVerifier.isBlank()
,isNotBlank()
. - Added
ArrayValidator/ArrayVerifier.asList()
. - Added
ArrayValidator/ArrayVerifier.isSorted(Comparator)
. - Added
ListValidator/ListVerifier.isSorted(Comparator)
.
- Added
- Improvements
- Diffs
- Split words on colons and semicolons.
- Improved readability by reducing the number of diff components per word.
- Improved readability by avoiding short diff components in short words, even if the overall number of components is low.
- Improved readability of Configuration
putContext()
replaced bywithContext()
removeContext()
replaced bywithoutContext()
- Improved readability of ThreadConfiguration
putContext()
replaced bywithContext()
removeContext()
replaced bywithoutContext()
removeAllContext()
replaced bywithoutAnyContext()
- Annotated methods whose return value should not be ignored with
com.github.cowwoc.requirements.annotation.CheckReturnValue
MainConfiguration.toString()
now handles multidimensional arrays.
- Diffs
- Bugfixes
ListValidator.isEqualTo()
was throwing aClassCastExeception
whenactual
was being compared to a non-List
.
- Deprecations
- Warn that
StringVerifier/Validator.asString()
are no-op operations.
- Warn that
- Breaking changes
- Increased minimum JDK version from 11 to 17.
- Renamed
com.github.cowwoc.requirements.annotations
tocom.github.cowwoc.requirements.annotation
. You shouldn't need to change your source code, but the project will need to be rebuilt.
- Bugfixes
- When list elements were unequal, but had the same string value, their types were not being compared.
- Improvements
- If a failure message is longer than the terminal width, push the expected value from the failure message to the exception context. This helps failure messages remain readable in the face of long values.
- Added
GlobalConfiguration.getTerminalWidth()
,withDefaultTerminalWidth()
,withTerminalWidth()
.
- Improvements
- Improved diff output for lists, multiline strings.
- Moved project from https://bitbucket.org/cowwoc/requirements.java/ to https://github.com/cowwoc/requirements.java/
- Breaking changes
- Changed groupId from
org.bitbucket.cowwoc.requirements
tocom.github.cowwoc.requirements
.
- Changed groupId from
- Bugfixes
cleanStackTrace()
was not being enforced ifThrowable.printStackTrace(PrintWriter)
was invoked.
- Bugfixes
ValidationFailureImpl.createMessageWithContext()
was throwingNullPointerException
if the context contained an empty line.
- Breaking changes
- Removed
PrimitiveArrayVerifier
.
- Removed
- Bugfixes
PrimitiveArrayVerifier.isNull()
,isNotNull()
was incorrectly showing up as deprecated.
- New features
- Added
ClassValidator.isSubtypeOf()
.
- Added
- Improvements
Configuration.putContext()
now retains the order in which entries were inserted into the map. Note that insertion order is not affected if a key is re-inserted into the map.ValidationFailure.getMessage()
now includes the failure context.asUri()
,asUrl()
,asInetAddress()
now mention the actual value's expected type when it is null.
- Bug fixes
- Multi-line diffs were sometimes incrementing line numbers when they shouldn't have.
- Multi-line diffs were sometimes treating changed lines as duplicates.
asString()
no longer fails if value is null. Instead, it converts the value to "null".
- Improvements
- Textual diffs now use
'+'
for characters that needs to be added,'-'
for characters that needs to be removed, and' '
for identical characters. End of stream is marked with \0 even for single-line diffs. - Optimize thrown
IOException
s (improves efficiency when the stack trace is not consumed).
- Textual diffs now use
- Bug fixes
isPositive()
was not failing forNaN
.
- New features
Configuration
(and all implementingRequirements
) are thread-safe. Verifiers, Validators still assume single-threaded use.
- Breaking changes
Configuration
methods now return updated configuration instead ofthis
.
- Bug fixes
assertThat()
was using the assertion status ofMainConfiguration
instead ofConfiguration
by mistake.GlobalConfiguration.isCleanStackTrace()
was being ignored.
-
New features
- Added
Requirements.validateThat()
, an entry-point that aggregates multiple errors before returning feedback to the user.
- Added
-
Breaking changes
- Verifiers now assume single-threaded use. This allows us to make some performance optimizations at the cost of thread-safety.
- Removed
Configuration.getException()
,withException()
,withDefaultException()
because they don't allow users to throw checked exceptions and removing them simplified the implementation. Users wishing to override the exception type should catch and wrap the thrown exception. - Replaced
ObjectVerifier.getActualIfPresent()
withgetActual()
andisActualAvailable()
because the previous API could not differentiate betweennull
and the value not being present. length(Consumer<PrimitiveNumberVerifier<Integer>)
andsize(Consumer<PrimitiveNumberVerifier<Integer>)
now take aConsumer<SizeVerifier>
argument.- Renamed
GlobalRequirements.isLibraryRemovedFromStackTrace()
tocleanStackTrace()
. - Moved annotations from
org.bitbucket.cowwoc.requirements.java.annotations
toorg.bitbucket.cowwoc.requirements.annotations
. - Renamed
ApiGenerator.apply()
towriteTo()
.
-
Bug fixes
CollectionVerifier<T>.isNotEqualTo(Object value)
should returntrue
whenvalue
is not of type<T>
(as opposed to throwing an exception).- Improved diff color scheme for IntelliJ IDEA.
- Don't diff
boolean
s. Terminal.setEncodingImpl()
wasn't actually setting the encoding unless the platform was Windows.
- Breaking changes
- Removed
Configuration.getConfiguration()
- Removed
- New features
- Java 11 support.
- Added
Object.isNotInstanceOf()
. - Added
ThreadRequirements
to specify contextual information on a thread-local level.
- Breaking changes
- All method parameters except for
addContext()
order their parameters as(value, name)
. This is the original method ordering from version 3.x.- Here is a regular expression to help automate the change. It isn't perfect (so be sure to review the changes) but it will handle most cases.
- Replace:
requireThat\("(.+?)", (.+?)\)\.
- With :
requireThat($2, "$1").
- Renamed
Requirements
toDefaultRequirements
andVerifiers
toRequirements
. You should be statically importingDefaultRequirements
from now on, and instantiateRequirements
if you wish to override the default configuration. - Renamed
GlobalConfiguration
toGlobalRequirements
. ComparableVerifier.isBetween()
now expects an exclusive upper-bound. Please useComparableVerifier.isBetweenClosed()
for the old functionality (when you need an inclusive upper-bound).- Renamed
groupId
fromorg.bitbucket.cowwoc
toorg.bitbucket.cowwoc.requirements
.artifactId
has also changed slightly. - Verifier methods that always return true or false are now
@Deprecated
and throw an exception explaining why the method should not be invoked. - Removed deprecated
TerminalEncoding.detect()
method. - Renamed
GlobalConfiguration.getAvailableTerminalEncodings()
tolistTerminalEncodings()
. - Renamed
GlobalConfiguration.apiInStacktrace()
toremoveLibraryFromStacktrace()
. - Renamed
Object.isIn()
toisOneOf()
,isNotIn()
toisNotOneOf()
. - Dropped 32-bit builds.
- All method parameters except for
- Minor changes
- Log using
DEBUG
level if the native library is missing, instead ofWARN
.
- Log using
- New features
- Added
ObjectVerifier.isSameObjectAs()
,isNotSameObjectAs()
. - Added
ArrayVerifier.doesNotContainExactly()
,CollectionVerifier.doesNotContainExactly()
. - Added verifiers for primitive arrays:
byte[]
,short[]
,int[]
,long[]
,double[]
,float[]
,boolean[]
andchar[]
.
- Added
- Bugfixes
CollectionVerifier.doesNotContainAny()
was listing the wrong unwanted elements on failure.
- New features
- Added
Comparable.isComparableTo()
,isNotComparableTo()
.
- Added
- Bugfixes
- NumberVerifier was handling fractional values incorrectly.
- Bugfixes
- Added support for Windows versions with four components (e.g. 10.0.16299.125). Previous versions only had three components.
- Breaking changes
- Swapped order of the
name
andvalue
parameters for all methods exceptaddContext()
. All methods now take parameters in the same order:(name, value)
- Here is a regular expression to help automate the change:
- Replace:
requireThat\((.+?), "(.+?)"\)\.
- With :
requireThat("$2", $1).
- Methods
isEquals()
,isNotEquals()
now compare toObject
instead ofT
.- This enables
requireThat("actual", someInteger).isEqualTo(someNumber)
which was previously not possible.
- This enables
- Textual diff omits "Diff" if lines are identical.
- Removed
Configurable.addContext(String key, Supplier<String> value)
. Configurable.getContext()
is now@Beta
because the return type might change in the future.
- Swapped order of the
- New features
- Added
Configurable.withStringConverter()
,withoutStringConverter()
. - Added verifiers for
char
values.
- Added
- Bugfixes
- If
actual != expected
but the String representations were equal, the output should have contained the actual value, but did not.
- If
- Bugfixes
- Fixed warning when running under Linux: "java.lang.UnsatisfiedLinkError: librequirements.so: /usr/lib64/libstdc++.so.6: version 'GLIBCXX_3.4.21' not found (required by librequirements.so)".
- New featurees
- Added
String.isTrimmed()
.
- Added
- New features
- Added
Configurable.withDiff()
,withoutDiff()
. - Ability to override String representation of context value
using
Configurable.addContext(String, Supplier<String>)
- Windows colored diffs now support
XTERM_8COLOR
terminal encoding.
- Added
- Improvements
- Only log an error once when the native library is not available.
- Bugfixes
Configuration
was supposed to be immutable butaddContext()
was modifying the object.- Colored diffs were not reseting colors at the end of each line.
- We no longer strip the padding marker from the end of diff lines.
XTERM_8COLOR
terminal encoding no longer uses "bold" attribute which it does not support.
- Bugfixes
- An
AssertionError
was thrown if a verifier threw an exception with a cause andGlobalConfiguration.apiInStacktrace
was false.
- An
- Bugfixes
- ANSI colors were being used on non-Windows platforms even when stdout was redirected.
- Bugfixes
OperatingSystem.Version.detect()
was failing if the operating-system version did not contain a build number (e.g. MacOS 10.12).- Windows 10 terminal was never using colors, even if they were supported.
- Changes
- Deprecated
TerminalEncoding.detect()
.
- Deprecated
- New features
- Added
BooleanVerifier
,PrimitiveBooleanVerifier
- Added
- Improvements
CollectionVerifier.getActual()
now returns subclasses of typeCollection
(e.g.List
,Iterable
).
- New features
- Added
StringVerifier.contains()
,doesNotContain()
- Added
- Bugfixes
- Verifier's default constructor was reusing the same Configuration across all Verifiers; fixed.
- New features
- Added requirements-maven-plugin:unpack for unpacking native libraries.
- Added
StringVerifier.asUrl()
,UriVerifier.asUrl()
andUrlVerifier
.
- New features
- Added
ObjectVerifier.isNotIn()
. - Added
requireThat()
,assertThat()
for all primitive numbers.
- Added
- Changes
- Deprecated
BigDecimal.precision().isNotZero()
,isPositive()
,isNotNegative()
. - Deprecated
CollectionVerifier.size().isNegative()
,isNotNegative()
. - Deprecated
isNotNull()
for primitive numbers.
- Deprecated
- Bugfixes
ContainerSizeVerifier
was outputtingActual
instead of the container name.BigDecimal.scale().isZero()
,isNotZero()
,isPositive()
,isNotPositive()
,isNegative()
,isNotNegative()
were not checking the actual value; fixed.Optional.isNotNull()
was not checking the actual value; fixed.
- Footprint/Performance
- Size decreased by 10%
- Version 2.0.7: 185KB across all modules.
- Version 3.0.0: 154 KB for the core module, 13KB for the Guava module
- requireThat() performance improved by 43%
- Size decreased by 10%
- New features
- If objects are not equal but their
toString()
looks the same, we compare their class, followed by theirhashCode()
. - Added
ObjectVerifier.getActual()
,ObjectVerifier.getActualIfPresent()
. - Added
ObjectVerifier.asString()
. - Added
StringVerifier.asUri()
. - Added
InetAddressVerifier.isIpV4()
,InetAddressVerifier.isIpV6()
. - Added
OptionalVerifier.contains()
. - Added
ArrayVerifier.asCollection()
andCollectionVerifier.asArray()
. - Added support for ANSI colors under Windows 10 build 14931 (and later) but this requires the use of a native library
- Added support for ANSI 24-bit colors for platforms that support it.
- If objects are not equal but their
- Breaking changes
- Separated project into
requirements-core
module for Core JDK classes andrequirements-guava
for Guava classes. - Replaced
AssertionVerifier
andRequirementVerifier
byVerifiers
. The neat thing about this class is that it exposes different functionality based on the modules present on the compiler classpath. - Any method that returns a new verifier (e.g.
MapVerifier.keySet()
) is expected to provide an overload that consumes the verifier instead of returning it. This mechanism replacesObjectVerifier.isolate()
which has been removed. - Renamed
MultimapVerifier.entrySet()
toMultimapVerifier.entries()
- Removed
StringVerifier.isEmailFormat()
because it wasn't adding sufficient value (there is no good way to validate emails offline). - Removed
@Beta
from all methods. Any methods that were kept are now considered stable. The remaining methods were removed. - Renamed
ComparableVerifier.isIn()
toComparableVerifier.isBetween()
. - Replaced
StringVerifier.isIpAddressFormat()
withStringVerifier.asInetAddress()
. - Now using
Requirements.globalConfiguration()
to configure system-wide settings instead of using system properties. - Verifiers are no longer configurable after
requireThat()
/assertThat()
are invoked.
- Separated project into
- Bugfixes
Array.length()
was invokingObject.toString()
instead ofArrays.toString()
ObjectVerifier.isInstanceOf()
was throwingNullPointerException
ifactual == null
.
- New features
- Added ArrayRequirements.
- Improved output for objects with the same toString() that are not equal.
- Bugfixes
Object.isEqualTo()
now handles the parameter or value being null.
- Bugfixes
- ANSI colors outputted on Windows 10 versions that did not support it; fixed.
Collection.size().isIn(Range)
,Map.size().isIn(Range)
andString.length().isIn(Range)
were outputting unicode characters; fixed.ComparableRequirementsImpl.isGreaterthanOrEqualTo()
was outputting the wrong parameter name.
- New features
- Added String diffs.
- Added
ObjectRequirements.isIn()
. - Added
RequirementVerifier
andAssertionVerifier
. - Added
DoubleRequirements.isNumber()
,isNotNumber()
,isFinite()
,isNotFinite()
.
- Changes
- Deprecated
Assertions
in favor ofAssertionVerifier
. - Deprecated methods that depend on Guava, in anticipation of an upcoming release that removes it as a dependency.
Map.entrySet()
,Map.keySet()
,Map.values()
now return the entry, key, value in "Actual" and the enclosing map in "Map".- Replaced
ObjectRequirements.withContext(Map<String, Object>)
withaddContext(String, Object)
.
- Deprecated
- Bugfixes
UriRequirements
was using the wrong parameter name in exception messages; fixed.
- New features
- Added Requirements.assertionsAreEnabled().
- Renamed library from
Preconditions
toRequirements
to imply that it handles more than just preconditions. - Breaking changes
- Renamed
ObjectPreconditions.usingException()
towithException()
.
- Renamed
- New features
- Added
ObjectPreconditions.withContext()
which allows users to pass in context to append to the exception message. - The library no longer shows up in exception stack-traces. Set
org.bitbucket.cowwoc.requirements.Requirements.showFullStackTrace
totrue
to disable this feature. - Added convenience methods
Requirements.assertThat()
.
- Added
- New feature
- Added
ComparablePreconditions
- Added
- New features
- Added
ObjectPreconditions.isolate()
for combining nested elements into a single statement. - Added
CollectionPreconditions.doesNotContainDuplicates()
. - Added
CollectionPreconditions.containsExactly()
. - Added
Assertions.isEnabled()
.
- Added
- New features
- Added ability to name element(s) passed to
CollectionPreconditions.contains*()
.
- Added ability to name element(s) passed to
- New features
- Added
CollectionPreconditions.containsAny()
,containsAll()
,doesNotContainAny()
anddoesNotContainAll()
.
- Added
- New feature
- Added locale-specific grouping separator to most numbers.
- New features
- Report actual value for
CollectionPreconditions.doesNotContain()
,NumberPreconditionsImpl.isNotNegative()
andisNotPositive()
.
- Report actual value for
- Bugfixes
Preconditions.usingException()
was throwing aClassCastException
if the precondition type was not Object.
- New features
- When objects are not equal, highlight the difference using a visual diff.
- New features
- Added
CollectionPreconditions.contains()
,doesNotContain()
- Added
- New features
- Added
Preconditions.isNotEqualTo()
- Added
- Bugfixes
- Order of parameters was reversed for
Collection.size()
,Map.size()
,String.length()
error messages.
- Order of parameters was reversed for
- New features
- Added
CollectionPreconditions.isEmpty()
andMapPreconditions.isEmpty()
- Added
- Bugfixes
- TestNG maven dependency was not test-scoped.
- Bugfixes
Assertions.requireThat()
was throwing aStackOverflowError
if assertions were enabled.
- New features
- Added
ObjectPreconditions.isEqualTo()
.
- Added
- New features
- Added
CollectionPreconditions.size()
- Added
- New features
- Improved modularity by adding preconditions over properties.
- Example:
Preconditions.requireThat(name, "name").length().isLessThanOrEqualTo(30)
instead ofPreconditions.requireThat(name, "name").hasMaximumLength(30)
.
- Example:
- Improved modularity by adding preconditions over properties.
- New features
- Added
AssertionPreconditions
(preconditions that get skipped if assertions are disabled)
- Added
- New features
- Added
YearPreconditions
- Added
OptionalPreconditions
- Added
- New features
- Added
StringPreconditions.isEmpty()
,trim()
.
- Added
- New features
- Added
BigDecimalPreconditions
- Added
- New features
StringPreconditions.lengthIn()
,hasMinimumLength()
,hasLength()
,hasMaximumLength()
now mention actual value on failure.
- New features
- Added
StringPreconditions.startsWith(String)
,doesNotStartWith(String)
,endsWith(String)
,doesNotEndWith(String)
.
- Added
- Breaking changes
- Renamed
StringPreconditions.isShorterThan()
tohasMaximumLength()
. - Renamed
StringPreconditions.isValidEmail()
toisEmailFormat()
.
- Renamed
- New features:
- Added
PathPreconditions.isRelative()
,isAbsolute()
. - Added
StringPreconditions.hasMinimumLength()
,hasLength()
,isIpAddressFormat()
.
- Added
- New features
- Added
NumberPreconditions
- Added
- Breaking change
- Swapped order of
Preconditions.requireThat()
parameters to facilitate migration from Guava.
- Swapped order of
- Breaking changes
- Renamed
Preconditions.valueOf()
toPreconditions.checkThat()
. PathPreconditions.exists()
now throwsIllegalArgumentException
instead ofIllegalStateException
.
- Renamed
- New features
- Added
Preconditions.isInstanceOf()
. - Added
ClassPreconditions
.
- Added
- Initial release