mirror of
https://github.com/honeymoose/OpenSearch.git
synced 2025-02-22 21:05:23 +00:00
parent
f45e6ae3f9
commit
a50d82c44b
@ -45,8 +45,7 @@ String json = "{" +
|
||||
[[using-map]]
|
||||
==== Using Map
|
||||
|
||||
Map is a key:values pair collection. It represents very well a JSON
|
||||
structure:
|
||||
Map is a key:values pair collection. It represents a JSON structure:
|
||||
|
||||
[source,java]
|
||||
--------------------------------------------------
|
||||
@ -87,7 +86,7 @@ import com.fasterxml.jackson.databind.*;
|
||||
ObjectMapper mapper = new ObjectMapper(); // create once, reuse
|
||||
|
||||
// generate json
|
||||
String json = mapper.writeValueAsString(yourbeaninstance);
|
||||
byte[] json = mapper.writeValueAsBytes(yourbeaninstance);
|
||||
--------------------------------------------------
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user