You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently each of KiwiLists and KiwiSets has methods that accept their respective type – List and Set – to check if they are null, empty, not null, not empty, etc. But since the argument types are more specialized, if you have a Collection<T>, you can't use them. We should have had these utilities in a utility class that accepts Collection<T> from the beginning, but at this point we can just add a new utility class that accepts Collection<T> as argument types.
I've recently run across situations in several services where I had a collection and wanted to check if (not) null/empty but couldn't use KiwiLists or KiwiSets.
So, KiwiCollections will initially contain the following methods, which are the ones most commonly used:
* Add KiwiCollections with three initial methods:
- isNullOrEmpty
- isNotNullOrEmpty
- hasOneElement
* Refactor KiwiPreconditions to use these new KiwiCollections methods
Closes#757
* Add KiwiCollections with three initial methods:
- isNullOrEmpty
- isNotNullOrEmpty
- hasOneElement
* Refactor KiwiPreconditions to use these new KiwiCollections methods
Closes#757
Currently each of
KiwiLists
andKiwiSets
has methods that accept their respective type –List
andSet
– to check if they are null, empty, not null, not empty, etc. But since the argument types are more specialized, if you have aCollection<T>
, you can't use them. We should have had these utilities in a utility class that acceptsCollection<T>
from the beginning, but at this point we can just add a new utility class that acceptsCollection<T>
as argument types.I've recently run across situations in several services where I had a collection and wanted to check if (not) null/empty but couldn't use
KiwiLists
orKiwiSets
.So,
KiwiCollections
will initially contain the following methods, which are the ones most commonly used:static <T> boolean isNullOrEmpty(Collection<T> collection)
static <T> boolean isNotNullOrEmpty(Collection<T> collection)
static <T> boolean hasOneElement(Collection<T> collection)
The text was updated successfully, but these errors were encountered: