@Test public void testDate() { Date d = new Date(1531204354961L - TimeZone.getDefault().getRawOffset() + TimeZone.getTimeZone("GMT+8").getRawOffset()); ObjectView objectView = new ObjectView(d, 3); String expected = "@Date[2018-07-10 14:32:34,961]"; 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();  }