# io.github.libtmux.Layouts.Layouts.requireSerialized

- **Module:** io.github.libtmux.Layouts.Layouts
- **Package:** io.github.libtmux:libtmux
- **Language:** Java
- **Kind:** method
- **Source:** https://github.com/libtmux/libtmux-java/blob/842228310449e879ebcaa3f910597757c9dbffd6/libtmux/src/main/java/io/github/libtmux/Layouts.java#L175
- **Page:** https://libtmux.org/en/java/latest/reference/io-github-libtmux-layouts-layouts-requireserialized/

```
io.github.libtmux.Layouts.Layouts.requireSerialized(layout: String, running: TmuxVersion) -> String
```

Requires an exact layout string rather than a built-in layout name.

The classic form answers "did tmux write this?" by its own checksum, without needing to
know what tmux is running. JSON carries nothing equivalent, so the only question left to ask
is "could this tmux have written it?" - which is a version, not a parse. Recognising the shape
is as far as this goes: a JSON body that passes the shape check but is not real is tmux's own
problem to refuse, and it does, safely, on every release that understands the format at all
(confirmed against next-3.9: malformed JSON answers an ordinary parse error, never a crash).

## Raises

- `IllegalArgumentException`: if the string is not a layout tmux wrote
- `UnsupportedTmuxVersionException`: if it is JSON-shaped but {@code running} predates the format, so it cannot be one this server wrote
