{"action":"created","comment":{"url":"https://api.github.com/repos/evrythng/evrythng-java-sdk/pulls/comments/32140703","id":32140703,"diff_hunk":"@@ -0,0 +1,71 @@\n+/*\n+ * (c) Copyright 2013 EVRYTHNG Ltd London / Zurich\n+ * www.evrythng.com\n+ */\n+package com.evrythng.java.wrapper.mapping;\n+\n+import java.io.IOException;\n+\n+import com.evrythng.thng.resource.model.store.geojson.GeoJson;\n+import com.fasterxml.jackson.core.JsonParser;\n+import com.fasterxml.jackson.core.JsonProcessingException;\n+import com.fasterxml.jackson.core.ObjectCodec;\n+import com.fasterxml.jackson.databind.DeserializationContext;\n+import com.fasterxml.jackson.databind.JsonNode;\n+import com.fasterxml.jackson.databind.ObjectMapper;\n+import com.fasterxml.jackson.databind.node.ObjectNode;\n+\n+/**\n+ * GeoJSON deserializer.\n+ * \n+ * @author colin\n+ **/\n+public class GeoJsonDeserializerImpl extends TypeMapDeserializer<GeoJson> implements GeoJsonDeserializer {\n+\n+\tprivate static final long serialVersionUID = 1L;\n+\n+\tGeoJsonDeserializerImpl() {\n+\t\tsuper(GeoJson.class, GeoJson.FIELD_TYPE);\n+\t}\n+\n+\t/**\n+\t * {@inheritDoc}\n+\t */\n+\t@Override\n+\tpublic <T extends GeoJson> String getGeoJsonType(Class<T> geoJsonClass) {\n+\t\treturn getObjectType(geoJsonClass);\n+\t}\n+\t\n+\t@Override\n+\tpublic GeoJson deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException, JsonProcessingException {\n+\t\tObjectCodec codec = jp.getCodec();\n+\t\tObjectMapper mapper = (ObjectMapper) codec;\n+\t\tObjectNode root = (ObjectNode) mapper.readTree(jp);\n+\t\tJsonNode type = root.get(getTypeFieldName());\n+\t\tif (type == null) {\n+\t\t\tthrow new IllegalArgumentException(this.getValueClass().getSimpleName() + \" type cannot be empty.\");\n+\t\t}\n+\t\tString sType = type.textValue();\n+\t\tif (sType == null || sType.isEmpty()) {\n+\t\t\tthrow new IllegalArgumentException(this.getValueClass().getSimpleName() + \" type cannot be empty.\");\n+\t\t}\n+\t\t\n+//\t\tdouble lon = root.path(IGeoJSON.FIELD_COORDINATES).get(GeoJSONPoint.LON_IDX).asDouble();","path":"evrythng-java-wrapper/src/main/java/com/evrythng/java/wrapper/mapping/GeoJsonDeserializerImpl.java","position":53,"original_position":53,"commit_id":"cdb3065d85da986fb4563ae113898acdd9755caf","original_commit_id":"cdb3065d85da986fb4563ae113898acdd9755caf","user":{"login":"coffeemachine","id":2082382,"avatar_url":"https://avatars.githubusercontent.com/u/2082382?v=3","gravatar_id":"","url":"https://api.github.com/users/coffeemachine","html_url":"https://github.com/coffeemachine","followers_url":"https://api.github.com/users/coffeemachine/followers","following_url":"https://api.github.com/users/coffeemachine/following{/other_user}","gists_url":"https://api.github.com/users/coffeemachine/gists{/gist_id}","starred_url":"https://api.github.com/users/coffeemachine/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/coffeemachine/subscriptions","organizations_url":"https://api.github.com/users/coffeemachine/orgs","repos_url":"https://api.github.com/users/coffeemachine/repos","events_url":"https://api.github.com/users/coffeemachine/events{/privacy}","received_events_url":"https://api.github.com/users/coffeemachine/received_events","type":"User","site_admin":false},"body":"Delete this","created_at":"2015-06-10T17:06:09Z","updated_at":"2015-06-10T17:06:09Z","html_url":"https://github.com/evrythng/evrythng-java-sdk/pull/64#discussion_r32140703","pull_request_url":"https://api.github.com/repos/evrythng/evrythng-java-sdk/pulls/64","_links":{"self":{"href":"https://api.github.com/repos/evrythng/evrythng-java-sdk/pulls/comments/32140703"},"html":{"href":"https://github.com/evrythng/evrythng-java-sdk/pull/64#discussion_r32140703"},"pull_request":{"href":"https://api.github.com/repos/evrythng/evrythng-java-sdk/pulls/64"}}},"pull_request":{"url":"https://api.github.com/repos/evrythng/evrythng-java-sdk/pulls/64","id":37380475,"html_url":"https://github.com/evrythng/evrythng-java-sdk/pull/64","diff_url":"https://github.com/evrythng/evrythng-java-sdk/pull/64.diff","patch_url":"https://github.com/evrythng/evrythng-java-sdk/pull/64.patch","issue_url":"https://api.github.com/repos/evrythng/evrythng-java-sdk/issues/64","number":64,"state":"open","locked":false,"title":"ENGINE-1360: Fixed deserialization for Property, GeoJson and Reaction","user":{"login":"dorogush","id":1249705,"avatar_url":"https://avatars.githubusercontent.com/u/1249705?v=3","gravatar_id":"","url":"https://api.github.com/users/dorogush","html_url":"https://github.com/dorogush","followers_url":"https://api.github.com/users/dorogush/followers","following_url":"https://api.github.com/users/dorogush/following{/other_user}","gists_url":"https://api.github.com/users/dorogush/gists{/gist_id}","starred_url":"https://api.github.com/users/dorogush/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dorogush/subscriptions","organizations_url":"https://api.github.com/users/dorogush/orgs","repos_url":"https://api.github.com/users/dorogush/repos","events_url":"https://api.github.com/users/dorogush/events{/privacy}","received_events_url":"https://api.github.com/users/dorogush/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-06-10T16:55:32Z","updated_at":"2015-06-10T17:06:09Z","closed_at":null,"merged_at":null,"merge_commit_sha":"35e59b22dd9876572272b930d694d2fa2fa2ed16","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/evrythng/evrythng-java-sdk/pulls/64/commits","review_comments_url":"https://api.github.com/repos/evrythng/evrythng-java-sdk/pulls/64/comments","review_comment_url":"https://api.github.com/repos/evrythng/evrythng-java-sdk/pulls/comments{/number}","comments_url":"https://api.github.com/repos/evrythng/evrythng-java-sdk/issues/64/comments","statuses_url":"https://api.github.com/repos/evrythng/evrythng-java-sdk/statuses/cdb3065d85da986fb4563ae113898acdd9755caf","head":{"label":"evrythng:ENGINE-1360","ref":"ENGINE-1360","sha":"cdb3065d85da986fb4563ae113898acdd9755caf","user":{"login":"evrythng","id":1073250,"avatar_url":"https://avatars.githubusercontent.com/u/1073250?v=3","gravatar_id":"","url":"https://api.github.com/users/evrythng","html_url":"https://github.com/evrythng","followers_url":"https://api.github.com/users/evrythng/followers","following_url":"https://api.github.com/users/evrythng/following{/other_user}","gists_url":"https://api.github.com/users/evrythng/gists{/gist_id}","starred_url":"https://api.github.com/users/evrythng/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/evrythng/subscriptions","organizations_url":"https://api.github.com/users/evrythng/orgs","repos_url":"https://api.github.com/users/evrythng/repos","events_url":"https://api.github.com/users/evrythng/events{/privacy}","received_events_url":"https://api.github.com/users/evrythng/received_events","type":"Organization","site_admin":false},"repo":{"id":3061876,"name":"evrythng-java-sdk","full_name":"evrythng/evrythng-java-sdk","owner":{"login":"evrythng","id":1073250,"avatar_url":"https://avatars.githubusercontent.com/u/1073250?v=3","gravatar_id":"","url":"https://api.github.com/users/evrythng","html_url":"https://github.com/evrythng","followers_url":"https://api.github.com/users/evrythng/followers","following_url":"https://api.github.com/users/evrythng/following{/other_user}","gists_url":"https://api.github.com/users/evrythng/gists{/gist_id}","starred_url":"https://api.github.com/users/evrythng/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/evrythng/subscriptions","organizations_url":"https://api.github.com/users/evrythng/orgs","repos_url":"https://api.github.com/users/evrythng/repos","events_url":"https://api.github.com/users/evrythng/events{/privacy}","received_events_url":"https://api.github.com/users/evrythng/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/evrythng/evrythng-java-sdk","description":"The Java SDK for the EVRYTHNG Cloud","fork":false,"url":"https://api.github.com/repos/evrythng/evrythng-java-sdk","forks_url":"https://api.github.com/repos/evrythng/evrythng-java-sdk/forks","keys_url":"https://api.github.com/repos/evrythng/evrythng-java-sdk/keys{/key_id}","collaborators_url":"https://api.github.com/repos/evrythng/evrythng-java-sdk/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/evrythng/evrythng-java-sdk/teams","hooks_url":"https://api.github.com/repos/evrythng/evrythng-java-sdk/hooks","issue_events_url":"https://api.github.com/repos/evrythng/evrythng-java-sdk/issues/events{/number}","events_url":"https://api.github.com/repos/evrythng/evrythng-java-sdk/events","assignees_url":"https://api.github.com/repos/evrythng/evrythng-java-sdk/assignees{/user}","branches_url":"https://api.github.com/repos/evrythng/evrythng-java-sdk/branches{/branch}","tags_url":"https://api.github.com/repos/evrythng/evrythng-java-sdk/tags","blobs_url":"https://api.github.com/repos/evrythng/evrythng-java-sdk/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/evrythng/evrythng-java-sdk/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/evrythng/evrythng-java-sdk/git/refs{/sha}","trees_url":"https://api.github.com/repos/evrythng/evrythng-java-sdk/git/trees{/sha}","statuses_url":"https://api.github.com/repos/evrythng/evrythng-java-sdk/statuses/{sha}","languages_url":"https://api.github.com/repos/evrythng/evrythng-java-sdk/languages","stargazers_url":"https://api.github.com/repos/evrythng/evrythng-java-sdk/stargazers","contributors_url":"https://api.github.com/repos/evrythng/evrythng-java-sdk/contributors","subscribers_url":"https://api.github.com/repos/evrythng/evrythng-java-sdk/subscribers","subscription_url":"https://api.github.com/repos/evrythng/evrythng-java-sdk/subscription","commits_url":"https://api.github.com/repos/evrythng/evrythng-java-sdk/commits{/sha}","git_commits_url":"https://api.github.com/repos/evrythng/evrythng-java-sdk/git/commits{/sha}","comments_url":"https://api.github.com/repos/evrythng/evrythng-java-sdk/comments{/number}","issue_comment_url":"https://api.github.com/repos/evrythng/evrythng-java-sdk/issues/comments{/number}","contents_url":"https://api.github.com/repos/evrythng/evrythng-java-sdk/contents/{+path}","compare_url":"https://api.github.com/repos/evrythng/evrythng-java-sdk/compare/{base}...{head}","merges_url":"https://api.github.com/repos/evrythng/evrythng-java-sdk/merges","archive_url":"https://api.github.com/repos/evrythng/evrythng-java-sdk/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/evrythng/evrythng-java-sdk/downloads","issues_url":"https://api.github.com/repos/evrythng/evrythng-java-sdk/issues{/number}","pulls_url":"https://api.github.com/repos/evrythng/evrythng-java-sdk/pulls{/number}","milestones_url":"https://api.github.com/repos/evrythng/evrythng-java-sdk/milestones{/number}","notifications_url":"https://api.github.com/repos/evrythng/evrythng-java-sdk/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/evrythng/evrythng-java-sdk/labels{/name}","releases_url":"https://api.github.com/repos/evrythng/evrythng-java-sdk/releases{/id}","created_at":"2011-12-28T09:38:55Z","updated_at":"2015-06-03T10:34:13Z","pushed_at":"2015-06-10T16:55:33Z","git_url":"git://github.com/evrythng/evrythng-java-sdk.git","ssh_url":"git@github.com:evrythng/evrythng-java-sdk.git","clone_url":"https://github.com/evrythng/evrythng-java-sdk.git","svn_url":"https://github.com/evrythng/evrythng-java-sdk","homepage":"https://dashboard.evrythng.com","size":4075,"stargazers_count":9,"watchers_count":9,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":5,"forks":2,"open_issues":5,"watchers":9,"default_branch":"master"}},"base":{"label":"evrythng:master","ref":"master","sha":"2f0093afe6ab2035660693fa2613aeb6b2fefdd4","user":{"login":"evrythng","id":1073250,"avatar_url":"https://avatars.githubusercontent.com/u/1073250?v=3","gravatar_id":"","url":"https://api.github.com/users/evrythng","html_url":"https://github.com/evrythng","followers_url":"https://api.github.com/users/evrythng/followers","following_url":"https://api.github.com/users/evrythng/following{/other_user}","gists_url":"https://api.github.com/users/evrythng/gists{/gist_id}","starred_url":"https://api.github.com/users/evrythng/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/evrythng/subscriptions","organizations_url":"https://api.github.com/users/evrythng/orgs","repos_url":"https://api.github.com/users/evrythng/repos","events_url":"https://api.github.com/users/evrythng/events{/privacy}","received_events_url":"https://api.github.com/users/evrythng/received_events","type":"Organization","site_admin":false},"repo":{"id":3061876,"name":"evrythng-java-sdk","full_name":"evrythng/evrythng-java-sdk","owner":{"login":"evrythng","id":1073250,"avatar_url":"https://avatars.githubusercontent.com/u/1073250?v=3","gravatar_id":"","url":"https://api.github.com/users/evrythng","html_url":"https://github.com/evrythng","followers_url":"https://api.github.com/users/evrythng/followers","following_url":"https://api.github.com/users/evrythng/following{/other_user}","gists_url":"https://api.github.com/users/evrythng/gists{/gist_id}","starred_url":"https://api.github.com/users/evrythng/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/evrythng/subscriptions","organizations_url":"https://api.github.com/users/evrythng/orgs","repos_url":"https://api.github.com/users/evrythng/repos","events_url":"https://api.github.com/users/evrythng/events{/privacy}","received_events_url":"https://api.github.com/users/evrythng/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/evrythng/evrythng-java-sdk","description":"The Java SDK for the EVRYTHNG Cloud","fork":false,"url":"https://api.github.com/repos/evrythng/evrythng-java-sdk","forks_url":"https://api.github.com/repos/evrythng/evrythng-java-sdk/forks","keys_url":"https://api.github.com/repos/evrythng/evrythng-java-sdk/keys{/key_id}","collaborators_url":"https://api.github.com/repos/evrythng/evrythng-java-sdk/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/evrythng/evrythng-java-sdk/teams","hooks_url":"https://api.github.com/repos/evrythng/evrythng-java-sdk/hooks","issue_events_url":"https://api.github.com/repos/evrythng/evrythng-java-sdk/issues/events{/number}","events_url":"https://api.github.com/repos/evrythng/evrythng-java-sdk/events","assignees_url":"https://api.github.com/repos/evrythng/evrythng-java-sdk/assignees{/user}","branches_url":"https://api.github.com/repos/evrythng/evrythng-java-sdk/branches{/branch}","tags_url":"https://api.github.com/repos/evrythng/evrythng-java-sdk/tags","blobs_url":"https://api.github.com/repos/evrythng/evrythng-java-sdk/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/evrythng/evrythng-java-sdk/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/evrythng/evrythng-java-sdk/git/refs{/sha}","trees_url":"https://api.github.com/repos/evrythng/evrythng-java-sdk/git/trees{/sha}","statuses_url":"https://api.github.com/repos/evrythng/evrythng-java-sdk/statuses/{sha}","languages_url":"https://api.github.com/repos/evrythng/evrythng-java-sdk/languages","stargazers_url":"https://api.github.com/repos/evrythng/evrythng-java-sdk/stargazers","contributors_url":"https://api.github.com/repos/evrythng/evrythng-java-sdk/contributors","subscribers_url":"https://api.github.com/repos/evrythng/evrythng-java-sdk/subscribers","subscription_url":"https://api.github.com/repos/evrythng/evrythng-java-sdk/subscription","commits_url":"https://api.github.com/repos/evrythng/evrythng-java-sdk/commits{/sha}","git_commits_url":"https://api.github.com/repos/evrythng/evrythng-java-sdk/git/commits{/sha}","comments_url":"https://api.github.com/repos/evrythng/evrythng-java-sdk/comments{/number}","issue_comment_url":"https://api.github.com/repos/evrythng/evrythng-java-sdk/issues/comments{/number}","contents_url":"https://api.github.com/repos/evrythng/evrythng-java-sdk/contents/{+path}","compare_url":"https://api.github.com/repos/evrythng/evrythng-java-sdk/compare/{base}...{head}","merges_url":"https://api.github.com/repos/evrythng/evrythng-java-sdk/merges","archive_url":"https://api.github.com/repos/evrythng/evrythng-java-sdk/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/evrythng/evrythng-java-sdk/downloads","issues_url":"https://api.github.com/repos/evrythng/evrythng-java-sdk/issues{/number}","pulls_url":"https://api.github.com/repos/evrythng/evrythng-java-sdk/pulls{/number}","milestones_url":"https://api.github.com/repos/evrythng/evrythng-java-sdk/milestones{/number}","notifications_url":"https://api.github.com/repos/evrythng/evrythng-java-sdk/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/evrythng/evrythng-java-sdk/labels{/name}","releases_url":"https://api.github.com/repos/evrythng/evrythng-java-sdk/releases{/id}","created_at":"2011-12-28T09:38:55Z","updated_at":"2015-06-03T10:34:13Z","pushed_at":"2015-06-10T16:55:33Z","git_url":"git://github.com/evrythng/evrythng-java-sdk.git","ssh_url":"git@github.com:evrythng/evrythng-java-sdk.git","clone_url":"https://github.com/evrythng/evrythng-java-sdk.git","svn_url":"https://github.com/evrythng/evrythng-java-sdk","homepage":"https://dashboard.evrythng.com","size":4075,"stargazers_count":9,"watchers_count":9,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":5,"forks":2,"open_issues":5,"watchers":9,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/evrythng/evrythng-java-sdk/pulls/64"},"html":{"href":"https://github.com/evrythng/evrythng-java-sdk/pull/64"},"issue":{"href":"https://api.github.com/repos/evrythng/evrythng-java-sdk/issues/64"},"comments":{"href":"https://api.github.com/repos/evrythng/evrythng-java-sdk/issues/64/comments"},"review_comments":{"href":"https://api.github.com/repos/evrythng/evrythng-java-sdk/pulls/64/comments"},"review_comment":{"href":"https://api.github.com/repos/evrythng/evrythng-java-sdk/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/evrythng/evrythng-java-sdk/pulls/64/commits"},"statuses":{"href":"https://api.github.com/repos/evrythng/evrythng-java-sdk/statuses/cdb3065d85da986fb4563ae113898acdd9755caf"}}}}