{"action":"created","comment":{"url":"https://api.github.com/repos/Cornutum/tcases/pulls/comments/205790212","pull_request_review_id":141132951,"id":205790212,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIwNTc5MDIxMg==","diff_hunk":"@@ -0,0 +1,172 @@\n+//////////////////////////////////////////////////////////////////////////////\n+// \n+//                    Copyright 2018, Cornutum Project\n+//                             www.cornutum.org\n+//\n+//////////////////////////////////////////////////////////////////////////////\n+\n+package org.cornutum.tcases.io;\n+\n+import java.math.BigDecimal;\n+import java.util.function.Function;\n+import java.util.stream.Stream;\n+\n+/**\n+ * Defines utility methods for reading and writing objects.\n+ *\n+ */\n+public final class ObjectUtils\n+  {\n+  private ObjectUtils()\n+    {\n+    // Static methods only\n+    }\n+  \n+  /**\n+   * Returns the object represented by the given string.\n+   */\n+  public static Object toObject( String value)\n+    {\n+    return toObject( value, toBoolean, toNumber, toString);\n+    }\n+  \n+  \n+  /**\n+   * Returns the first non-null object produced by the given converters.\n+   * Returns null if no such object found.\n+   */\n+  @SafeVarargs\n+  private static <T> Object toObject( T value, Function<T,Object>... converters)\n+    {\n+    return\n+      Stream.of( converters)\n+      .map( converter -> converter.apply( value))\n+      .filter( object -> object != null)\n+      .findFirst()\n+      .orElse( null);\n+    }\n+\n+  /**\n+   * Returns the Boolean represented by the given string, or null if not a boolean value.\n+   */\n+  private static Function<String,Object> toBoolean =\n+    new Function<String,Object>()\n+      {\n+      public Object apply( String value)\n+        {\n+        return\n+          \"true\".equalsIgnoreCase( value)?\n+          Boolean.TRUE :\n+\n+          \"false\".equalsIgnoreCase( value)?\n+          Boolean.FALSE :\n+\n+          null;\n+        }\n+      };\n+\n+  /**\n+   * Returns the given String value.\n+   */\n+  private static Function<String,Object> toString =\n+    new Function<String, Object>()\n+      {\n+      public Object apply( String value)\n+        {\n+        // \"null\" is string representation of null\n+        return\n+          \"null\".equals( value)","path":"tcases-lib/src/main/java/org/cornutum/tcases/io/ObjectUtils.java","position":78,"original_position":78,"commit_id":"81581b134b7068fa30d40d9a8678a7450de8db08","original_commit_id":"81581b134b7068fa30d40d9a8678a7450de8db08","user":{"login":"kerrykimbrough","id":6577913,"node_id":"MDQ6VXNlcjY1Nzc5MTM=","avatar_url":"https://avatars2.githubusercontent.com/u/6577913?v=4","gravatar_id":"","url":"https://api.github.com/users/kerrykimbrough","html_url":"https://github.com/kerrykimbrough","followers_url":"https://api.github.com/users/kerrykimbrough/followers","following_url":"https://api.github.com/users/kerrykimbrough/following{/other_user}","gists_url":"https://api.github.com/users/kerrykimbrough/gists{/gist_id}","starred_url":"https://api.github.com/users/kerrykimbrough/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kerrykimbrough/subscriptions","organizations_url":"https://api.github.com/users/kerrykimbrough/orgs","repos_url":"https://api.github.com/users/kerrykimbrough/repos","events_url":"https://api.github.com/users/kerrykimbrough/events{/privacy}","received_events_url":"https://api.github.com/users/kerrykimbrough/received_events","type":"User","site_admin":false},"body":"That's a reasonable point. But this conversion applies only to (de)serialization with XML. In that context, it seems simpler to recognize \"null\" as the standard string representation.","created_at":"2018-07-27T14:20:44Z","updated_at":"2018-07-27T14:20:45Z","html_url":"https://github.com/Cornutum/tcases/pull/39#discussion_r205790212","pull_request_url":"https://api.github.com/repos/Cornutum/tcases/pulls/39","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/Cornutum/tcases/pulls/comments/205790212"},"html":{"href":"https://github.com/Cornutum/tcases/pull/39#discussion_r205790212"},"pull_request":{"href":"https://api.github.com/repos/Cornutum/tcases/pulls/39"}},"in_reply_to_id":205744721},"pull_request":{"url":"https://api.github.com/repos/Cornutum/tcases/pulls/39","id":204236524,"node_id":"MDExOlB1bGxSZXF1ZXN0MjA0MjM2NTI0","html_url":"https://github.com/Cornutum/tcases/pull/39","diff_url":"https://github.com/Cornutum/tcases/pull/39.diff","patch_url":"https://github.com/Cornutum/tcases/pull/39.patch","issue_url":"https://api.github.com/repos/Cornutum/tcases/issues/39","number":39,"state":"open","locked":false,"title":"The \"name\" of a VarValueDef can be any Java object, including null","user":{"login":"kerrykimbrough","id":6577913,"node_id":"MDQ6VXNlcjY1Nzc5MTM=","avatar_url":"https://avatars2.githubusercontent.com/u/6577913?v=4","gravatar_id":"","url":"https://api.github.com/users/kerrykimbrough","html_url":"https://github.com/kerrykimbrough","followers_url":"https://api.github.com/users/kerrykimbrough/followers","following_url":"https://api.github.com/users/kerrykimbrough/following{/other_user}","gists_url":"https://api.github.com/users/kerrykimbrough/gists{/gist_id}","starred_url":"https://api.github.com/users/kerrykimbrough/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kerrykimbrough/subscriptions","organizations_url":"https://api.github.com/users/kerrykimbrough/orgs","repos_url":"https://api.github.com/users/kerrykimbrough/repos","events_url":"https://api.github.com/users/kerrykimbrough/events{/privacy}","received_events_url":"https://api.github.com/users/kerrykimbrough/received_events","type":"User","site_admin":false},"body":"Resolves issue #35 and issue #37","created_at":"2018-07-26T19:00:34Z","updated_at":"2018-07-27T14:20:45Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4ca7d7c41467941411b111fff3ff8a29bba45e29","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/Cornutum/tcases/pulls/39/commits","review_comments_url":"https://api.github.com/repos/Cornutum/tcases/pulls/39/comments","review_comment_url":"https://api.github.com/repos/Cornutum/tcases/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Cornutum/tcases/issues/39/comments","statuses_url":"https://api.github.com/repos/Cornutum/tcases/statuses/81581b134b7068fa30d40d9a8678a7450de8db08","head":{"label":"Cornutum:value-object","ref":"value-object","sha":"81581b134b7068fa30d40d9a8678a7450de8db08","user":{"login":"Cornutum","id":11477145,"node_id":"MDEyOk9yZ2FuaXphdGlvbjExNDc3MTQ1","avatar_url":"https://avatars3.githubusercontent.com/u/11477145?v=4","gravatar_id":"","url":"https://api.github.com/users/Cornutum","html_url":"https://github.com/Cornutum","followers_url":"https://api.github.com/users/Cornutum/followers","following_url":"https://api.github.com/users/Cornutum/following{/other_user}","gists_url":"https://api.github.com/users/Cornutum/gists{/gist_id}","starred_url":"https://api.github.com/users/Cornutum/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Cornutum/subscriptions","organizations_url":"https://api.github.com/users/Cornutum/orgs","repos_url":"https://api.github.com/users/Cornutum/repos","events_url":"https://api.github.com/users/Cornutum/events{/privacy}","received_events_url":"https://api.github.com/users/Cornutum/received_events","type":"Organization","site_admin":false},"repo":{"id":32223373,"node_id":"MDEwOlJlcG9zaXRvcnkzMjIyMzM3Mw==","name":"tcases","full_name":"Cornutum/tcases","owner":{"login":"Cornutum","id":11477145,"node_id":"MDEyOk9yZ2FuaXphdGlvbjExNDc3MTQ1","avatar_url":"https://avatars3.githubusercontent.com/u/11477145?v=4","gravatar_id":"","url":"https://api.github.com/users/Cornutum","html_url":"https://github.com/Cornutum","followers_url":"https://api.github.com/users/Cornutum/followers","following_url":"https://api.github.com/users/Cornutum/following{/other_user}","gists_url":"https://api.github.com/users/Cornutum/gists{/gist_id}","starred_url":"https://api.github.com/users/Cornutum/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Cornutum/subscriptions","organizations_url":"https://api.github.com/users/Cornutum/orgs","repos_url":"https://api.github.com/users/Cornutum/repos","events_url":"https://api.github.com/users/Cornutum/events{/privacy}","received_events_url":"https://api.github.com/users/Cornutum/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Cornutum/tcases","description":"A model-based test case generator","fork":false,"url":"https://api.github.com/repos/Cornutum/tcases","forks_url":"https://api.github.com/repos/Cornutum/tcases/forks","keys_url":"https://api.github.com/repos/Cornutum/tcases/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Cornutum/tcases/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Cornutum/tcases/teams","hooks_url":"https://api.github.com/repos/Cornutum/tcases/hooks","issue_events_url":"https://api.github.com/repos/Cornutum/tcases/issues/events{/number}","events_url":"https://api.github.com/repos/Cornutum/tcases/events","assignees_url":"https://api.github.com/repos/Cornutum/tcases/assignees{/user}","branches_url":"https://api.github.com/repos/Cornutum/tcases/branches{/branch}","tags_url":"https://api.github.com/repos/Cornutum/tcases/tags","blobs_url":"https://api.github.com/repos/Cornutum/tcases/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Cornutum/tcases/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Cornutum/tcases/git/refs{/sha}","trees_url":"https://api.github.com/repos/Cornutum/tcases/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Cornutum/tcases/statuses/{sha}","languages_url":"https://api.github.com/repos/Cornutum/tcases/languages","stargazers_url":"https://api.github.com/repos/Cornutum/tcases/stargazers","contributors_url":"https://api.github.com/repos/Cornutum/tcases/contributors","subscribers_url":"https://api.github.com/repos/Cornutum/tcases/subscribers","subscription_url":"https://api.github.com/repos/Cornutum/tcases/subscription","commits_url":"https://api.github.com/repos/Cornutum/tcases/commits{/sha}","git_commits_url":"https://api.github.com/repos/Cornutum/tcases/git/commits{/sha}","comments_url":"https://api.github.com/repos/Cornutum/tcases/comments{/number}","issue_comment_url":"https://api.github.com/repos/Cornutum/tcases/issues/comments{/number}","contents_url":"https://api.github.com/repos/Cornutum/tcases/contents/{+path}","compare_url":"https://api.github.com/repos/Cornutum/tcases/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Cornutum/tcases/merges","archive_url":"https://api.github.com/repos/Cornutum/tcases/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Cornutum/tcases/downloads","issues_url":"https://api.github.com/repos/Cornutum/tcases/issues{/number}","pulls_url":"https://api.github.com/repos/Cornutum/tcases/pulls{/number}","milestones_url":"https://api.github.com/repos/Cornutum/tcases/milestones{/number}","notifications_url":"https://api.github.com/repos/Cornutum/tcases/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Cornutum/tcases/labels{/name}","releases_url":"https://api.github.com/repos/Cornutum/tcases/releases{/id}","deployments_url":"https://api.github.com/repos/Cornutum/tcases/deployments","created_at":"2015-03-14T17:22:38Z","updated_at":"2018-07-24T22:27:00Z","pushed_at":"2018-07-27T02:54:25Z","git_url":"git://github.com/Cornutum/tcases.git","ssh_url":"git@github.com:Cornutum/tcases.git","clone_url":"https://github.com/Cornutum/tcases.git","svn_url":"https://github.com/Cornutum/tcases","homepage":"","size":5778,"stargazers_count":27,"watchers_count":27,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":16,"mirror_url":null,"archived":false,"open_issues_count":5,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":16,"open_issues":5,"watchers":27,"default_branch":"master"}},"base":{"label":"Cornutum:master","ref":"master","sha":"708ae73d7ec93ff635b232afb47d9b3428c7348c","user":{"login":"Cornutum","id":11477145,"node_id":"MDEyOk9yZ2FuaXphdGlvbjExNDc3MTQ1","avatar_url":"https://avatars3.githubusercontent.com/u/11477145?v=4","gravatar_id":"","url":"https://api.github.com/users/Cornutum","html_url":"https://github.com/Cornutum","followers_url":"https://api.github.com/users/Cornutum/followers","following_url":"https://api.github.com/users/Cornutum/following{/other_user}","gists_url":"https://api.github.com/users/Cornutum/gists{/gist_id}","starred_url":"https://api.github.com/users/Cornutum/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Cornutum/subscriptions","organizations_url":"https://api.github.com/users/Cornutum/orgs","repos_url":"https://api.github.com/users/Cornutum/repos","events_url":"https://api.github.com/users/Cornutum/events{/privacy}","received_events_url":"https://api.github.com/users/Cornutum/received_events","type":"Organization","site_admin":false},"repo":{"id":32223373,"node_id":"MDEwOlJlcG9zaXRvcnkzMjIyMzM3Mw==","name":"tcases","full_name":"Cornutum/tcases","owner":{"login":"Cornutum","id":11477145,"node_id":"MDEyOk9yZ2FuaXphdGlvbjExNDc3MTQ1","avatar_url":"https://avatars3.githubusercontent.com/u/11477145?v=4","gravatar_id":"","url":"https://api.github.com/users/Cornutum","html_url":"https://github.com/Cornutum","followers_url":"https://api.github.com/users/Cornutum/followers","following_url":"https://api.github.com/users/Cornutum/following{/other_user}","gists_url":"https://api.github.com/users/Cornutum/gists{/gist_id}","starred_url":"https://api.github.com/users/Cornutum/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Cornutum/subscriptions","organizations_url":"https://api.github.com/users/Cornutum/orgs","repos_url":"https://api.github.com/users/Cornutum/repos","events_url":"https://api.github.com/users/Cornutum/events{/privacy}","received_events_url":"https://api.github.com/users/Cornutum/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Cornutum/tcases","description":"A model-based test case generator","fork":false,"url":"https://api.github.com/repos/Cornutum/tcases","forks_url":"https://api.github.com/repos/Cornutum/tcases/forks","keys_url":"https://api.github.com/repos/Cornutum/tcases/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Cornutum/tcases/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Cornutum/tcases/teams","hooks_url":"https://api.github.com/repos/Cornutum/tcases/hooks","issue_events_url":"https://api.github.com/repos/Cornutum/tcases/issues/events{/number}","events_url":"https://api.github.com/repos/Cornutum/tcases/events","assignees_url":"https://api.github.com/repos/Cornutum/tcases/assignees{/user}","branches_url":"https://api.github.com/repos/Cornutum/tcases/branches{/branch}","tags_url":"https://api.github.com/repos/Cornutum/tcases/tags","blobs_url":"https://api.github.com/repos/Cornutum/tcases/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Cornutum/tcases/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Cornutum/tcases/git/refs{/sha}","trees_url":"https://api.github.com/repos/Cornutum/tcases/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Cornutum/tcases/statuses/{sha}","languages_url":"https://api.github.com/repos/Cornutum/tcases/languages","stargazers_url":"https://api.github.com/repos/Cornutum/tcases/stargazers","contributors_url":"https://api.github.com/repos/Cornutum/tcases/contributors","subscribers_url":"https://api.github.com/repos/Cornutum/tcases/subscribers","subscription_url":"https://api.github.com/repos/Cornutum/tcases/subscription","commits_url":"https://api.github.com/repos/Cornutum/tcases/commits{/sha}","git_commits_url":"https://api.github.com/repos/Cornutum/tcases/git/commits{/sha}","comments_url":"https://api.github.com/repos/Cornutum/tcases/comments{/number}","issue_comment_url":"https://api.github.com/repos/Cornutum/tcases/issues/comments{/number}","contents_url":"https://api.github.com/repos/Cornutum/tcases/contents/{+path}","compare_url":"https://api.github.com/repos/Cornutum/tcases/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Cornutum/tcases/merges","archive_url":"https://api.github.com/repos/Cornutum/tcases/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Cornutum/tcases/downloads","issues_url":"https://api.github.com/repos/Cornutum/tcases/issues{/number}","pulls_url":"https://api.github.com/repos/Cornutum/tcases/pulls{/number}","milestones_url":"https://api.github.com/repos/Cornutum/tcases/milestones{/number}","notifications_url":"https://api.github.com/repos/Cornutum/tcases/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Cornutum/tcases/labels{/name}","releases_url":"https://api.github.com/repos/Cornutum/tcases/releases{/id}","deployments_url":"https://api.github.com/repos/Cornutum/tcases/deployments","created_at":"2015-03-14T17:22:38Z","updated_at":"2018-07-24T22:27:00Z","pushed_at":"2018-07-27T02:54:25Z","git_url":"git://github.com/Cornutum/tcases.git","ssh_url":"git@github.com:Cornutum/tcases.git","clone_url":"https://github.com/Cornutum/tcases.git","svn_url":"https://github.com/Cornutum/tcases","homepage":"","size":5778,"stargazers_count":27,"watchers_count":27,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":16,"mirror_url":null,"archived":false,"open_issues_count":5,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":16,"open_issues":5,"watchers":27,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Cornutum/tcases/pulls/39"},"html":{"href":"https://github.com/Cornutum/tcases/pull/39"},"issue":{"href":"https://api.github.com/repos/Cornutum/tcases/issues/39"},"comments":{"href":"https://api.github.com/repos/Cornutum/tcases/issues/39/comments"},"review_comments":{"href":"https://api.github.com/repos/Cornutum/tcases/pulls/39/comments"},"review_comment":{"href":"https://api.github.com/repos/Cornutum/tcases/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Cornutum/tcases/pulls/39/commits"},"statuses":{"href":"https://api.github.com/repos/Cornutum/tcases/statuses/81581b134b7068fa30d40d9a8678a7450de8db08"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"kerrykimbrough"}}