@Override public Object comment(Object... comment) { Comment complexComment = factory.createComment(); for (Object c : comment) { complexComment.getContent().add(c); } complexComment.setType(Blockstyle.DEFAULT); return complexComment; }
@Override public Object comment(String comment) { Comment simpleComment = factory.createComment(); simpleComment.getContent().add(comment); simpleComment.setType(Blockstyle.DEFAULT); return simpleComment; }
@Override public Object comment(List<Object> comment) { Comment complexComment = factory.createComment(); for (Object c : comment) { complexComment.getContent().add(c); } complexComment.setType(Blockstyle.DEFAULT); return complexComment; }
@Override public String doRender(Object o) { if (!(o instanceof Comment)) return null; Comment comment = (Comment) o; StringBuilder builder = new StringBuilder(); builder.append("Comment" + " -> "); for (Object c : comment.getContent()) { if(c instanceof String) { builder.append((String)c); } if(c instanceof Textarea) { builder.append(((Textarea)c).getName()); } if(c instanceof Screenshot) { builder.append("Screenshot" + " [" + ((Screenshot)c).getUrl() + "]"); } builder.append("; "); } return builder.toString(); }
@Override public Object comment(List<Object> comment, LogStyle style) { Comment complexComment = factory.createComment(); for (Object c : comment) { complexComment.getContent().add(c); } if (style == LogStyle.HIGHLIGHT) complexComment.setType(Blockstyle.HIGHLIGHT); else complexComment.setType(Blockstyle.DEFAULT); return complexComment; }
@Override public Object comment(String comment, LogStyle style) { Comment simpleComment = factory.createComment(); simpleComment.getContent().add(comment); if (style == LogStyle.HIGHLIGHT) simpleComment.setType(Blockstyle.HIGHLIGHT); else simpleComment.setType(Blockstyle.DEFAULT); return simpleComment; }