4243444546474849
public static String encode(Object obj) throws EncodeException { try { return mapper.writeValueAsString(obj); } catch (Exception e) { throw new EncodeException("Failed to encode as JSON: " + e.getMessage()); } }
5051525354555657
public static String encodePrettily(Object obj) throws EncodeException { try { return prettyMapper.writeValueAsString(obj); } catch (Exception e) { throw new EncodeException("Failed to encode as JSON: " + e.getMessage()); } }