@Test public void testGetContentFieldAsStrings_when_field_is_empty() throws IncorrectFieldTypeException { LocalDocument ld = new LocalDocument(); assertTrue(ld.getContentFieldAsStrings("field_that_does_not_exist").isEmpty()); }
@SuppressWarnings("unchecked") public List<String> getContentFieldAsStrings(String fieldName) throws IncorrectFieldTypeException { List<String> list; list = getContentFieldAsType(fieldName, List.class); if (null == list) { list = new ArrayList<String>(); } return list; }
LocalDocument implements Document<Local> { @SuppressWarnings("unchecked") public List<String> getContentFieldAsStrings(String fieldName) throws IncorrectFieldTypeException { List<String> list; list = getContentFieldAsType(fieldName, List.class); if (null == list) { list = new ArrayList<String>(); } return list; } }
LocalDocument implements Document<Local> { @SuppressWarnings("unchecked") public List<String> getContentFieldAsStrings(String fieldName) throws IncorrectFieldTypeException { List<String> list; list = getContentFieldAsType(fieldName, List.class); if (null == list) { list = new ArrayList<String>(); } return list; } LocalDocument();  LocalDocument(String json);  LocalDocument(LocalDocument doc); }
LocalDocument implements Document<Local> { @SuppressWarnings("unchecked") public List<String> getContentFieldAsStrings(String fieldName) throws IncorrectFieldTypeException { List<String> list; list = getContentFieldAsType(fieldName, List.class); if (null == list) { list = new ArrayList<String>(); } return list; } LocalDocument();  LocalDocument(String json);  LocalDocument(LocalDocument doc); @Override Action getAction(); @Override void setAction(Action action); final void markSynced(); boolean isSynced(); @Override boolean hasContentField(String fieldName); @SuppressWarnings("unchecked") @Override boolean hasMetadataField(String fieldName); @Override LocalDocumentID getID(); void setID(DocumentID<Local> id); @SuppressWarnings("unchecked") Map<String, Object> getContentMap(); @SuppressWarnings("unchecked") Map<String, Object> getMetadataMap(); @Override final Object putContentField(String fieldName, Object value); @SuppressWarnings("unchecked") void appendToContentField(String fieldName, Object value); @Override Object getContentField(String fieldName); String getContentFieldAsString(String fieldName); @SuppressWarnings("unchecked") List<String> getContentFieldAsStrings(String fieldName); @SuppressWarnings("unchecked") Map<String, Object> getContentFieldAsMap(String fieldName); long getContentFieldAsLong(String fieldName); long getContentFieldAsLong(String fieldName, long defaultValue); double getContentFieldAsDouble(String fieldName); double getContentFieldAsDouble(String fieldName, double defaultValue); T getContentFieldAsType(String fieldName, Class<? extends T> type); @Override Set<String> getContentFields(); @Override boolean hasErrors(); @SuppressWarnings({ "unchecked", "rawtypes" }) @Override void addError(String from, Throwable t); @SuppressWarnings("unchecked") @Override final void fromJson(String json); @Override void putAll(Document<?> d); @Override String toJson(); @Override boolean isEqual(Document<?> d); @Override String contentFieldsToJson(Iterable<String> contentFields); @Override String metadataFieldsToJson(Iterable<String> metadataFields); String modifiedFieldsToJson(); Map<String, Object> toMap(); @Override void clear(); @Override String toString(); @Override Status getStatus(); Set<String> getTouchedContent(); Set<String> getTouchedMetadata(); boolean isTouchedAction(); @Override Object removeContentField(String key); void setDocumentFileRepository(DocumentFileRepository documentFileRepository); List<String> getFileNames(); DocumentFile<Local> getFile(String fileName); List<DocumentFile<Local>> getFiles(); boolean saveFile(DocumentFile<Local> file); boolean deleteFile(String fileName); void discard(); boolean isDiscarded(); }
LocalDocument implements Document<Local> { @SuppressWarnings("unchecked") public List<String> getContentFieldAsStrings(String fieldName) throws IncorrectFieldTypeException { List<String> list; list = getContentFieldAsType(fieldName, List.class); if (null == list) { list = new ArrayList<String>(); } return list; } LocalDocument();  LocalDocument(String json);  LocalDocument(LocalDocument doc); @Override Action getAction(); @Override void setAction(Action action); final void markSynced(); boolean isSynced(); @Override boolean hasContentField(String fieldName); @SuppressWarnings("unchecked") @Override boolean hasMetadataField(String fieldName); @Override LocalDocumentID getID(); void setID(DocumentID<Local> id); @SuppressWarnings("unchecked") Map<String, Object> getContentMap(); @SuppressWarnings("unchecked") Map<String, Object> getMetadataMap(); @Override final Object putContentField(String fieldName, Object value); @SuppressWarnings("unchecked") void appendToContentField(String fieldName, Object value); @Override Object getContentField(String fieldName); String getContentFieldAsString(String fieldName); @SuppressWarnings("unchecked") List<String> getContentFieldAsStrings(String fieldName); @SuppressWarnings("unchecked") Map<String, Object> getContentFieldAsMap(String fieldName); long getContentFieldAsLong(String fieldName); long getContentFieldAsLong(String fieldName, long defaultValue); double getContentFieldAsDouble(String fieldName); double getContentFieldAsDouble(String fieldName, double defaultValue); T getContentFieldAsType(String fieldName, Class<? extends T> type); @Override Set<String> getContentFields(); @Override boolean hasErrors(); @SuppressWarnings({ "unchecked", "rawtypes" }) @Override void addError(String from, Throwable t); @SuppressWarnings("unchecked") @Override final void fromJson(String json); @Override void putAll(Document<?> d); @Override String toJson(); @Override boolean isEqual(Document<?> d); @Override String contentFieldsToJson(Iterable<String> contentFields); @Override String metadataFieldsToJson(Iterable<String> metadataFields); String modifiedFieldsToJson(); Map<String, Object> toMap(); @Override void clear(); @Override String toString(); @Override Status getStatus(); Set<String> getTouchedContent(); Set<String> getTouchedMetadata(); boolean isTouchedAction(); @Override Object removeContentField(String key); void setDocumentFileRepository(DocumentFileRepository documentFileRepository); List<String> getFileNames(); DocumentFile<Local> getFile(String fileName); List<DocumentFile<Local>> getFiles(); boolean saveFile(DocumentFile<Local> file); boolean deleteFile(String fileName); void discard(); boolean isDiscarded();  }