@Test public void testObjectToStringFromActivityNoteWithNoContent() { assertNull(sut.extractContent(BaseObjectType.NOTE, new HashMap<String, String>())); }
public String extractContent(final BaseObjectType inBaseObjectType, final HashMap<String, String> inBaseObject) { StringBuffer sb = new StringBuffer(); if (inBaseObject != null) { switch (inBaseObjectType) { case NOTE: if (inBaseObject.containsKey("content")) { sb.append(inBaseObject.get("content")); } break; case BOOKMARK: if (inBaseObject.containsKey("content")) { sb.append(inBaseObject.get("content")); } if (inBaseObject.containsKey("targetTitle")) { sb.append(" "); sb.append(inBaseObject.get("targetTitle")); } if (inBaseObject.containsKey("description")) { sb.append(" "); sb.append(inBaseObject.get("description")); } break; case FILE: if (inBaseObject.containsKey("targetTitle")) { sb.append(inBaseObject.get("targetTitle")); } break; default: log.error("I don't know how to pull the content from activities of type: " + inBaseObject.toString()); break; } } return sb.toString().length() > 0 ? sb.toString() : null; }
ActivityContentExtractor { public String extractContent(final BaseObjectType inBaseObjectType, final HashMap<String, String> inBaseObject) { StringBuffer sb = new StringBuffer(); if (inBaseObject != null) { switch (inBaseObjectType) { case NOTE: if (inBaseObject.containsKey("content")) { sb.append(inBaseObject.get("content")); } break; case BOOKMARK: if (inBaseObject.containsKey("content")) { sb.append(inBaseObject.get("content")); } if (inBaseObject.containsKey("targetTitle")) { sb.append(" "); sb.append(inBaseObject.get("targetTitle")); } if (inBaseObject.containsKey("description")) { sb.append(" "); sb.append(inBaseObject.get("description")); } break; case FILE: if (inBaseObject.containsKey("targetTitle")) { sb.append(inBaseObject.get("targetTitle")); } break; default: log.error("I don't know how to pull the content from activities of type: " + inBaseObject.toString()); break; } } return sb.toString().length() > 0 ? sb.toString() : null; } }
ActivityContentExtractor { public String extractContent(final BaseObjectType inBaseObjectType, final HashMap<String, String> inBaseObject) { StringBuffer sb = new StringBuffer(); if (inBaseObject != null) { switch (inBaseObjectType) { case NOTE: if (inBaseObject.containsKey("content")) { sb.append(inBaseObject.get("content")); } break; case BOOKMARK: if (inBaseObject.containsKey("content")) { sb.append(inBaseObject.get("content")); } if (inBaseObject.containsKey("targetTitle")) { sb.append(" "); sb.append(inBaseObject.get("targetTitle")); } if (inBaseObject.containsKey("description")) { sb.append(" "); sb.append(inBaseObject.get("description")); } break; case FILE: if (inBaseObject.containsKey("targetTitle")) { sb.append(inBaseObject.get("targetTitle")); } break; default: log.error("I don't know how to pull the content from activities of type: " + inBaseObject.toString()); break; } } return sb.toString().length() > 0 ? sb.toString() : null; }  }
ActivityContentExtractor { public String extractContent(final BaseObjectType inBaseObjectType, final HashMap<String, String> inBaseObject) { StringBuffer sb = new StringBuffer(); if (inBaseObject != null) { switch (inBaseObjectType) { case NOTE: if (inBaseObject.containsKey("content")) { sb.append(inBaseObject.get("content")); } break; case BOOKMARK: if (inBaseObject.containsKey("content")) { sb.append(inBaseObject.get("content")); } if (inBaseObject.containsKey("targetTitle")) { sb.append(" "); sb.append(inBaseObject.get("targetTitle")); } if (inBaseObject.containsKey("description")) { sb.append(" "); sb.append(inBaseObject.get("description")); } break; case FILE: if (inBaseObject.containsKey("targetTitle")) { sb.append(inBaseObject.get("targetTitle")); } break; default: log.error("I don't know how to pull the content from activities of type: " + inBaseObject.toString()); break; } } return sb.toString().length() > 0 ? sb.toString() : null; }  String extractContent(final BaseObjectType inBaseObjectType, final HashMap<String, String> inBaseObject); }
ActivityContentExtractor { public String extractContent(final BaseObjectType inBaseObjectType, final HashMap<String, String> inBaseObject) { StringBuffer sb = new StringBuffer(); if (inBaseObject != null) { switch (inBaseObjectType) { case NOTE: if (inBaseObject.containsKey("content")) { sb.append(inBaseObject.get("content")); } break; case BOOKMARK: if (inBaseObject.containsKey("content")) { sb.append(inBaseObject.get("content")); } if (inBaseObject.containsKey("targetTitle")) { sb.append(" "); sb.append(inBaseObject.get("targetTitle")); } if (inBaseObject.containsKey("description")) { sb.append(" "); sb.append(inBaseObject.get("description")); } break; case FILE: if (inBaseObject.containsKey("targetTitle")) { sb.append(inBaseObject.get("targetTitle")); } break; default: log.error("I don't know how to pull the content from activities of type: " + inBaseObject.toString()); break; } } return sb.toString().length() > 0 ? sb.toString() : null; }  String extractContent(final BaseObjectType inBaseObjectType, final HashMap<String, String> inBaseObject);  }