@Test public void testMap() { Map<String, String> data = new LinkedHashMap<String, String>(); data.put("key1", "value1"); data.put("key2", "value2"); ObjectView objectView = new ObjectView(data, 3); String expected = "@LinkedHashMap[\n" + " @String[key1]:@String[value1],\n" + " @String[key2]:@String[value2],\n" + "]"; Assert.assertEquals(expected, objectView.draw()); }
@Override public String draw() { StringBuilder buf = new StringBuilder(); try { if (GlobalOptions.isUsingJson) { return JSON.toJSONString(object, SerializerFeature.IgnoreErrorGetter); } renderObject(object, 0, deep, buf); return buf.toString(); } catch (ObjectTooLargeException e) { buf.append(" Object size exceeds size limit: ") .append(maxObjectLength) .append(", try to specify -M size_limit in your command, check the help command for more."); return buf.toString(); } catch (Throwable t) { return "ERROR DATA!!! exception message: " + t.getMessage(); } }
ObjectView implements View { @Override public String draw() { StringBuilder buf = new StringBuilder(); try { if (GlobalOptions.isUsingJson) { return JSON.toJSONString(object, SerializerFeature.IgnoreErrorGetter); } renderObject(object, 0, deep, buf); return buf.toString(); } catch (ObjectTooLargeException e) { buf.append(" Object size exceeds size limit: ") .append(maxObjectLength) .append(", try to specify -M size_limit in your command, check the help command for more."); return buf.toString(); } catch (Throwable t) { return "ERROR DATA!!! exception message: " + t.getMessage(); } } }
ObjectView implements View { @Override public String draw() { StringBuilder buf = new StringBuilder(); try { if (GlobalOptions.isUsingJson) { return JSON.toJSONString(object, SerializerFeature.IgnoreErrorGetter); } renderObject(object, 0, deep, buf); return buf.toString(); } catch (ObjectTooLargeException e) { buf.append(" Object size exceeds size limit: ") .append(maxObjectLength) .append(", try to specify -M size_limit in your command, check the help command for more."); return buf.toString(); } catch (Throwable t) { return "ERROR DATA!!! exception message: " + t.getMessage(); } } ObjectView(Object object, int deep);  ObjectView(Object object, int deep, int maxObjectLength); }
ObjectView implements View { @Override public String draw() { StringBuilder buf = new StringBuilder(); try { if (GlobalOptions.isUsingJson) { return JSON.toJSONString(object, SerializerFeature.IgnoreErrorGetter); } renderObject(object, 0, deep, buf); return buf.toString(); } catch (ObjectTooLargeException e) { buf.append(" Object size exceeds size limit: ") .append(maxObjectLength) .append(", try to specify -M size_limit in your command, check the help command for more."); return buf.toString(); } catch (Throwable t) { return "ERROR DATA!!! exception message: " + t.getMessage(); } } ObjectView(Object object, int deep);  ObjectView(Object object, int deep, int maxObjectLength); @Override String draw(); }
ObjectView implements View { @Override public String draw() { StringBuilder buf = new StringBuilder(); try { if (GlobalOptions.isUsingJson) { return JSON.toJSONString(object, SerializerFeature.IgnoreErrorGetter); } renderObject(object, 0, deep, buf); return buf.toString(); } catch (ObjectTooLargeException e) { buf.append(" Object size exceeds size limit: ") .append(maxObjectLength) .append(", try to specify -M size_limit in your command, check the help command for more."); return buf.toString(); } catch (Throwable t) { return "ERROR DATA!!! exception message: " + t.getMessage(); } } ObjectView(Object object, int deep);  ObjectView(Object object, int deep, int maxObjectLength); @Override String draw();  }