# io.github.libtmux.query.Selections.Selections

- **Module:** io.github.libtmux.query.Selections
- **Package:** io.github.libtmux:libtmux
- **Language:** Java
- **Kind:** class
- **Source:** https://github.com/libtmux/libtmux-java/blob/c3517519ee799428a809ce6deb1708c8be289cd1/libtmux/src/main/java/io/github/libtmux/query/Selections.java#L14
- **Page:** https://libtmux.org/reference/java/io-github-libtmux-query-selections-selections/

Cardinality with the ambiguity removed.

<p>"No session matched" and "several sessions matched" are different bugs in a caller's code, so
they get different exceptions. {@code findFirst} stays on {@link java.util.stream.Stream} where it
already belongs; only the strict shapes need helpers.

## Members

- `exactlyOne` (method) — The single match, or a failure naming which way the count was wrong.
- `oneOrEmpty` (method) — The single match if there is one, empty if there is none — but still a failure for several.
- `NoMatchException` (class) — Nothing matched where the caller required something.
- `MultipleMatchesException` (class) — Several things matched where the caller required at most one.
