Selections
Cardinality with the ambiguity removed.
Source and package
- Qualified name
-
io.github .libtmux .query. Selections - Package
- io.github.libtmux.query
- Distribution
- io.github.libtmux:libtmux
- Source
- libtmux/src/main/java/io/github/libtmux/query/Selections.java
-
Description#
"No session matched" and "several sessions matched" are different bugs in a caller's code, so they get different exceptions.
findFirststays onjava.util.stream.Streamwhere it already belongs; only the strict shapes need helpers.
Members2#
Common operations1#
- exactlyOne method The single match, or a failure naming which way the count was wrong.
Other members1#
- oneOrEmpty method The single match if there is one, empty if there is none — but still a failure for several.