Last active
December 31, 2015 19:09
-
-
Save tleyden/8031420 to your computer and use it in GitHub Desktop.
Person CouchbaseLite
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Person { | |
private Document document; | |
private Map<String, Object> properties; | |
public Person() { | |
this(getDatabaseSomehow().createDocument()); | |
} | |
public Person(Document documentParam) { | |
document = documentParam; | |
properties = new HashMap<String, Object>(); | |
properties.putAll(document.getProperties()); | |
} | |
public void setName(String name) { | |
properties.put("name", name); | |
} | |
public void getName() { | |
document.getProperty("name"); | |
} | |
public void save() throws CouchbaseLiteException { | |
document.putProperties(properties); | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment