ContractReturnValue (@NotNull String value) { return switch (value) { case "_" -> returnAny(); case "fail" -> fail(); case "true" -> returnTrue(); case "false" -> returnFalse(); case "null" -> returnNull(); case "!null" -> returnNotNull(); case "new" -> returnNew(); case "this" -> returnThis(); default -> { if (value.startsWith("param")) { String suffix = value.substring("param".length()); try { int paramNumber = Integer.parseInt(suffix) - 1; if (paramNumber >= 0 && paramNumber <= MAX_SUPPORTED_PARAMETER) { yield new ParameterReturnValue(paramNumber); } } catch (NumberFormatException ignored) { // unexpected non-integer suffix: ignore } } yield null; } }; }