Interface JsonMapper


public interface JsonMapper
A mapper for mapping to basic Java types.

This supports the basic Java types of String, Boolean, Integer, Long, Double and Maps and List of these.

If avaje-jsonb is available then you will use that and NOT use this JsonMapper at all. This JsonMapper is intended to be used by code that ONLY wants to depend on avaje-json-core and process the basic Java types or provide its own JsonAdapters.

For full support with more types and binding to custom types use avaje-jsonb instead.

Example



   static final JsonMapper jsonMapper = JsonMapper.builder().build();

   Map<String, Long> map = new LinkedHashMap<>();
   map.put("one", 45L);
   map.put("two", 93L);

   String asJson = jsonMapper.toJson(map);