Releases: align-technologies/DBC-Android
1.6.5
1.6.4
Android X Update
Merge pull request #25 from simon-the-canadian/master commiting gradle properties
Fixes "Dex cannot parse version 52 byte code"
Merge pull request #20 from trevjonez/master revert build script
Fixes #18
Set checks and array support via list wrapping
Merge pull request #17 from trevjonez/master Set checks and primitive array support via List checks
Map `containsValue` and new android.os.Bundle checks
Merge pull request #14 from trevjonez/master RFC: Bundle checks
`isNotEqualTo(...)` & Collection size checks
Adds isNotEqualTo(...)
to the base checks and is available on all types.
Adds size is >
, >=
,<
, <=
checks to collections conditions.
WARNING: Due to the change of type in method signatures (String
became CharSequence
) this change causes a binary incompatibility, all calling code of those methods should be recompiled against 1.4.0 My apologies for the inconvenience.
Fails method addition
Adds a fails(DbcBlock)
method to the set of possible assertions. The fails method expects a false return value or will trigger a DbcAssertionError.
Where you would previously do something like:
check(classLiteral).passes((subject) -> !(subject.isInterface()))
you can now do:
check(classLiteral).fails((subject) -> subject.isInterface())
which can be reduced further to:
check(classLiteral).fails(Class::isInterface)
Support annotations & generic base type
This adds a generic type key for the ObjectCondition
so that a check like this:
require(typeToAdd).isNotNull().passes(subject -> !((Class) subject).isInterface());
can be cleaned up to look like this:
require(typeToAdd).isNotNull().passes(subject -> !subject.isInterface());
It also adds the @CheckResult
annotation so that a line like this:
check(someVar).message("This should not be null");
will be labeled as an error by android studio so that you know to update it to this:
check(someVar).message("This should not be null").isNotNull();