-
-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Release 10.0 #12
Merged
Merged
Release 10.0 #12
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…is optimized-away by the JIT. Unnecessary checks for null only cost a few nanoseconds. * Wrapped value in MaybeUndefined. * Added GenericType for casting to types with type parameters. * Refactored code to improve reuse \-> Binary size increased due to the use of lambdas, but code should be easier to maintain. * Removed MutableStringMappers.toString(Object). Use StringMappers.toString(Object) instead. * Moved classes from com.github.cowwoc.requirements.java.type to com.github.cowwoc.requirements.java.validator. * StringMapper.apply(object) now takes a second parameter: StringMapper.apply(object, seen). * Removed unused png files. * Design discussion * Why separate primitive and boxes validators? For convenience, not as much for performance-reasons. JMH benchmarks on changeset eb7463f reveal that * There is a 3% performance gain if we separate validators for boxed and primitive types. This includes arrays. * There is a 5% performance gain if we separate validator for long and int primitive types. * The only real downside of using boxed types everywhere is that `getValue()` returns a nullable type even if we know that the value will not be null. * Arrays of primitive types are different because Java does not box `int[]` as `Integer[]`.
cowwoc
force-pushed
the
release-10.0
branch
2 times, most recently
from
July 29, 2024 17:17
808c1c9
to
6cc9d1e
Compare
* Added Validator.add() and Validator.or() logical operators. * Removed all type converters from ObjectValidator and StringValidator because the concept does not scale. We can't just keep on adding methods to these centralized classes.
…t that()" * Removed all public references to the validator configuration and the ability to create custom validator factories. * Renamed Configuration.lazyExceptions to recordStacktrace. * Use normal StampedLock because we don't actually need a reentrant lock.
…aximumIsExclusive. * Renamed lazyExceptions to recordStacktrace.
* Implemented GenericType.isPrimitive(). * Removed UrlValidator since it doesn't do anything after converters have been removed. * Removed more references to "Configuration" from the public API. * Removed GenericType.asArrayComponent().
* Renamed MaybeUndefined to ValidationTarget. * Improve readability of validations using ValidationTarget.validationFailed() method. * ValidationTarget only wraps the value being validated. Optional parameters are null if omitted or undefined. * Removed all type-conversion methods.
…ied ValidationTarget.validationFailed() to fail on null values and use ValidationTarget.map() for cases where a null value may be valid.
\-> Inputs cannot use List.of() because it forbids nulls. \-> Name cannot contain spaces. \-> Output does not treat each element as a separate context value.
cowwoc
force-pushed
the
release-10.0
branch
from
September 16, 2024 11:11
f017260
to
d75cda7
Compare
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.