Last active
March 16, 2022 14:42
-
-
Save wplong11/6d1d1fc0faf4c5784cd93bf62cdda414 to your computer and use it in GitHub Desktop.
QueryDSL.kt
This file contains hidden or 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
fun anyOf( | |
items: Collection<Predicate>, | |
): BooleanBuilder = BooleanBuilder().andAnyOf(*items.toTypedArray()) | |
fun anyOf( | |
vararg args: Predicate?, | |
): BooleanBuilder = andAnyOf(args.filterNotNull()) | |
fun allOf( | |
items: Collection<Predicate>, | |
): BooleanBuilder = BooleanBuilder().and( | |
items.fold( | |
initial = BooleanBuilder(), | |
operation = BooleanBuilder::and::invoke, | |
) | |
) | |
fun allOf( | |
vararg args: Predicate?, | |
): BooleanBuilder = andAllOf(args.filterNotNull()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
example: