@Override public void saveDoc(String id, Doc doc) throws IOException { Map<String, String> data = new HashMap<String, String>(); data.put(DOC_NAME, doc.get(Doc.Field.NAME)); data.put(DOC_DESCRIPTION, doc.get(Doc.Field.DESCRIPTION)); _saveData(id, data); }
@Override public Doc loadDoc(String id) throws IOException { Map<String, String> data = _loadData(id); Doc doc = new Doc(); doc.set(Doc.Field.NAME, data.get(DOC_NAME)); doc.set(Doc.Field.DESCRIPTION, data.get(DOC_DESCRIPTION)); return doc; }