Propose new collection and map argument checking methods in KiwiPreconditions #708
Closed
sleberknight
started this conversation in
Ideas
Replies: 2 comments
-
Partially implemented by #753 (via PR #754) - includes the |
Beta Was this translation helpful? Give feedback.
0 replies
-
Marking this as resolved. We don't really need the other proposed methods at present. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Propose adding methods to check collection and/or map arguments for things like emptiness, specific sizes, etc.
Examples:
<T> checkArgumentNotEmpty(Collection<T> items)
<T> checkArgumentHasSizeExactly(Collection<T> items, int exactSize)
<T> checkArgumentHasSizeAtLeast(Collection<T> items, int minimumSize)
<T> checkArgumentHasSizeAtMost(Collection<T> items, int maximumSize)
<K, V> checkArgumentNotEmpty(Map<K, V> map)
I actually needed (wanted) the collection and map "not empty" variants recently. The exact, min, and max size are things that might be "nice to have". Of course could have the same size variants for
Map
arguments.Each should have the three "standard" variants:
Beta Was this translation helpful? Give feedback.
All reactions