[
https://issues.apache.org/jira/browse/CURATOR-397?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15961934#comment-15961934
]
ASF GitHub Bot commented on CURATOR-397:
----------------------------------------
Github user Randgalt commented on the issue:
https://github.com/apache/curator/pull/211
This new feature allows code like this:
```java
// let "client" be a CuratorFramework instance
ZPath path = ZPath.parse(...); // whatever path you need
JacksonModelSerializer<Person> serializer =
JacksonModelSerializer.build(Person.class);
ModeledAsyncCuratorFramework<MyModel> modeled =
ModeledAsyncCuratorFramework.wrap(client, path, serializer);
...
public void writePerson(String id, Person p) {
modeled.at(id).create(p); // note this is an async operation
}
public void readPerson(String id, Consumer<Person> receiver) {
modeled.at(id).read().whenComplete((person, exception) -> {
if ( exception != null ) {
...
} else {
receiver.accept(person);
}
});
}
```
> Created strongly typed model DSL
> --------------------------------
>
> Key: CURATOR-397
> URL: https://issues.apache.org/jira/browse/CURATOR-397
> Project: Apache Curator
> Issue Type: New Feature
> Components: Client, Framework
> Affects Versions: 3.3.0
> Reporter: Jordan Zimmerman
> Assignee: Jordan Zimmerman
>
> All of Curator's CRUD methods work with raw byte arrays. It would be nice to
> be able to use strongly type Models.
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)