@@ -57,11 +57,11 @@ Library provides *MediaType* class for correctly parsing and interpreting MediaT
57
57
There are plenty of widely used and preconfigured MediaTypes.
58
58
59
59
``` java
60
- MediaType jsonType = MediaType . APPLICATION_JSON_UTF_8_TYPE ;
60
+ MediaType jsonMediaTypeUtf8 = MediaType . APPLICATION_JSON_UTF_8_TYPE ;
61
61
62
- MediaType type1 = MediaType . of(" application/json" );
62
+ MediaType mediaType = MediaType . of(" application/json" );
63
63
64
- Optional<MediaType > type2 = MediaType . ofExtension(" json" );
64
+ Optional<MediaType > jsonMediaType = MediaType . ofExtension(" json" );
65
65
```
66
66
67
67
## URIBuilder
@@ -80,17 +80,30 @@ URIBuilder.of("https://api.etherscan.io").path("/api")
80
80
Describes HTTP headers and can be instantiated via different builders available.
81
81
82
82
``` java
83
- final Map<String , List<String > > h = new HashMap<> ();
84
- h . put(HttpHeaders . CONNECTION , List . of(" keep-alive" ));
85
- h . put(HttpHeaders . CONTENT_LENGTH , List . of(" 72" ));
86
- h . put(HttpHeaders . CONTENT_TYPE , List . of(" application/json" ));
83
+ final Map<String , List<String > > headerMap = new HashMap<> ();
84
+ headerMap . put(HttpHeaders . CONNECTION , List . of(" keep-alive" ));
85
+ headerMap . put(HttpHeaders . CONTENT_LENGTH , List . of(" 72" ));
86
+ headerMap . put(HttpHeaders . CONTENT_TYPE , List . of(" application/json" ));
87
87
88
- final HttpHeaders headers = HttpHeaders . ofMultiMap(h );
88
+ final HttpHeaders headers = HttpHeaders . ofMultiMap(headerMap );
89
89
90
90
final Optional<Long > contentLength = headers. contentLength();
91
91
final Optional<MediaType > mediaType = headers. contentType();
92
92
```
93
93
94
+ ## FormattedException
95
+
96
+ Exception that allow to format messages like SLF4J logger and other similar.
97
+
98
+ ``` java
99
+ throw new FormattedException (" Failed for {} with code {}" , " Bob" , 200 );
100
+ ```
101
+
102
+ Resulted exception message:
103
+ ``` text
104
+ Failed for Bob with code 200
105
+ ```
106
+
94
107
## License
95
108
96
109
This project licensed under the Apache License 2.0 - see the [ LICENSE] ( LICENSE ) file for details
0 commit comments