@Override
			public Boolean decode(String str) {
				Boolean result = switch (str.trim().toLowerCase()) {
					case "true" -> true;
					case "false" -> false;
					default -> null;
				};
				if (result == null) {
					throw new IllegalArgumentException(
						"Invalid bool for %s: %s. Only true or false is allowed."
								.formatted(AT_ENV, str));
				}
				return result;
			}
A parser for reading attributes from a script header
Ghidra/Debug/Debugger-rmi-trace/src/main/java/ghidra/app/plugin/core/debug/gui/tracermi/launcher/ScriptAttributesParser.java