Consider adding argument checking methods to KiwiPreconditions for arrays #950
sleberknight
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
We have
checkArgumentNotEmpty
for collections and maps. Issue #949 will addcheckArgumentNotNullOrEmpty
as well.Some code I just wrote in service-discovery-client needed to perform the same checks on a vararg argument, so having the same methods that accept an array would be nice. The question is whether to only do this for reference types, i.e.
T[] values
, or also for all the primitive arrays. Supporting the primitives as well would add a ton of new methods (three for each primitive type to support our "standard" set of argument variants), so it seems like maybe best to not do this at all, or only support reference types. Even just supporting reference types adds six new methods if we docheckArgumentNotEmpty
andcheckArgumentNotNullOrEmpty
forT[]
.Beta Was this translation helpful? Give feedback.
All reactions