Skip to content

Instantly share code, notes, and snippets.

@hamnis
Last active December 25, 2015 14:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hamnis/6992064 to your computer and use it in GitHub Desktop.
Save hamnis/6992064 to your computer and use it in GitHub Desktop.
{
"collection": {
"href": "http://example.com/events",
"template": {
"data": [
{"name": "classifier", "prompt": "Classifier", "value": ""},
{"name": "timestamp", "prompt": "Timestamp of event (ISO-8601 formatted)", "value": "" },
{"name": "event", "object": {}}
]
},
"links": [
{"href": "urn:example:event", "rel": "profile"}
]
}
}
import java.util.Arrays;
import net.hamnaberg.json;
public class TemplateUse {
public static void main(String[] args) {
Template template = Template.create(Arrays.asList(
Property.template("faff"),
Property.template("foof"),
Property.template("feee")
);
}
}
{
"template": {
"data": [
{"name": "classifier", "prompt": "Classifier", "value": "faff"},
{"name": "timestamp", "prompt": "Timestamp of event (ISO-8601 formatted)", "value": "2013-01-01T00:00:00.00Z" },
{"name": "event", "object": {
"pakker": "faff",
"forsendelser_sendt": 4000
}}
]
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment