{"action":"created","comment":{"url":"https://api.github.com/repos/aws/aws-sdk-java-v2/pulls/comments/149789259","pull_request_review_id":75237007,"id":149789259,"diff_hunk":"@@ -0,0 +1,59 @@\n+/*\n+ * Copyright 2010-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n+ *\n+ * Licensed under the Apache License, Version 2.0 (the \"License\").\n+ * You may not use this file except in compliance with the License.\n+ * A copy of the License is located at\n+ *\n+ *  http://aws.amazon.com/apache2.0\n+ *\n+ * or in the \"license\" file accompanying this file. This file is distributed\n+ * on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either\n+ * express or implied. See the License for the specific language governing\n+ * permissions and limitations under the License.\n+ */\n+\n+package software.amazon.awssdk.services.dynamodb.utils;\n+\n+import java.nio.ByteBuffer;\n+import software.amazon.awssdk.services.dynamodb.model.AttributeValue;\n+\n+public final class AttributeValueHelper {\n+    private AttributeValueHelper() {}\n+\n+    public static AttributeValue attr(String s) {\n+        return AttributeValue.builder().s(s).build();\n+    }\n+\n+    public static AttributeValue attr(Number n) {\n+        return AttributeValue.builder().n(String.valueOf(n)).build();\n+    }\n+\n+    public static AttributeValue attr(Boolean bool) {\n+        return AttributeValue.builder().bool(bool).build();\n+    }\n+\n+    public static AttributeValue attr(ByteBuffer binary) {\n+        return AttributeValue.builder().b(binary).build();\n+    }\n+\n+    public static AttributeValue attr(byte[] binary) {\n+        return attr(ByteBuffer.wrap(binary));\n+    }\n+\n+    public static AttributeValue attr(Object object) {","path":"services/dynamodb/src/main/java/software/amazon/awssdk/services/dynamodb/utils/AttributeValueHelper.java","position":44,"original_position":44,"commit_id":"0077f17d5725b72d30c8cb5fd3a08f68d288c610","original_commit_id":"0077f17d5725b72d30c8cb5fd3a08f68d288c610","user":{"login":"millems","id":24903526,"avatar_url":"https://avatars0.githubusercontent.com/u/24903526?v=4","gravatar_id":"","url":"https://api.github.com/users/millems","html_url":"https://github.com/millems","followers_url":"https://api.github.com/users/millems/followers","following_url":"https://api.github.com/users/millems/following{/other_user}","gists_url":"https://api.github.com/users/millems/gists{/gist_id}","starred_url":"https://api.github.com/users/millems/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/millems/subscriptions","organizations_url":"https://api.github.com/users/millems/orgs","repos_url":"https://api.github.com/users/millems/repos","events_url":"https://api.github.com/users/millems/events{/privacy}","received_events_url":"https://api.github.com/users/millems/received_events","type":"User","site_admin":false},"body":"What's this used for? Can we have a use method name so that we can have type checking on the method parameters? `AttributeValueHelper.attr(new Object())` would be nice to catch at compile time. A reasonable person could assume that if the method takes an object, it would work.","created_at":"2017-11-08T20:35:34Z","updated_at":"2017-11-08T20:36:15Z","html_url":"https://github.com/aws/aws-sdk-java-v2/pull/276#discussion_r149789259","pull_request_url":"https://api.github.com/repos/aws/aws-sdk-java-v2/pulls/276","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/aws/aws-sdk-java-v2/pulls/comments/149789259"},"html":{"href":"https://github.com/aws/aws-sdk-java-v2/pull/276#discussion_r149789259"},"pull_request":{"href":"https://api.github.com/repos/aws/aws-sdk-java-v2/pulls/276"}}},"pull_request":{"url":"https://api.github.com/repos/aws/aws-sdk-java-v2/pulls/276","id":151456219,"html_url":"https://github.com/aws/aws-sdk-java-v2/pull/276","diff_url":"https://github.com/aws/aws-sdk-java-v2/pull/276.diff","patch_url":"https://github.com/aws/aws-sdk-java-v2/pull/276.patch","issue_url":"https://api.github.com/repos/aws/aws-sdk-java-v2/issues/276","number":276,"state":"open","locked":false,"title":"Adding some helpers for being able to create DyanmoDB AttributeValues.","user":{"login":"kiiadi","id":4661536,"avatar_url":"https://avatars3.githubusercontent.com/u/4661536?v=4","gravatar_id":"","url":"https://api.github.com/users/kiiadi","html_url":"https://github.com/kiiadi","followers_url":"https://api.github.com/users/kiiadi/followers","following_url":"https://api.github.com/users/kiiadi/following{/other_user}","gists_url":"https://api.github.com/users/kiiadi/gists{/gist_id}","starred_url":"https://api.github.com/users/kiiadi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kiiadi/subscriptions","organizations_url":"https://api.github.com/users/kiiadi/orgs","repos_url":"https://api.github.com/users/kiiadi/repos","events_url":"https://api.github.com/users/kiiadi/events{/privacy}","received_events_url":"https://api.github.com/users/kiiadi/received_events","type":"User","site_admin":false},"body":"<!--- Provide a general summary of your changes in the Title above -->\r\n\r\n## Description\r\nCreating `AttributeValues` is very verbose for such a simple data-type, these helpers allow creating item maps and attribute values from simple method calls.\r\n\r\n## Testing\r\nAdded new unit tests\r\n\r\n","created_at":"2017-11-08T18:12:09Z","updated_at":"2017-11-08T20:36:15Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5c47886d6001c60f86b464fa4a13e0e03b7c7290","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/aws/aws-sdk-java-v2/pulls/276/commits","review_comments_url":"https://api.github.com/repos/aws/aws-sdk-java-v2/pulls/276/comments","review_comment_url":"https://api.github.com/repos/aws/aws-sdk-java-v2/pulls/comments{/number}","comments_url":"https://api.github.com/repos/aws/aws-sdk-java-v2/issues/276/comments","statuses_url":"https://api.github.com/repos/aws/aws-sdk-java-v2/statuses/0077f17d5725b72d30c8cb5fd3a08f68d288c610","head":{"label":"aws:kiiadi/easing-the-dynamo-pain","ref":"kiiadi/easing-the-dynamo-pain","sha":"0077f17d5725b72d30c8cb5fd3a08f68d288c610","user":{"login":"aws","id":2232217,"avatar_url":"https://avatars3.githubusercontent.com/u/2232217?v=4","gravatar_id":"","url":"https://api.github.com/users/aws","html_url":"https://github.com/aws","followers_url":"https://api.github.com/users/aws/followers","following_url":"https://api.github.com/users/aws/following{/other_user}","gists_url":"https://api.github.com/users/aws/gists{/gist_id}","starred_url":"https://api.github.com/users/aws/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aws/subscriptions","organizations_url":"https://api.github.com/users/aws/orgs","repos_url":"https://api.github.com/users/aws/repos","events_url":"https://api.github.com/users/aws/events{/privacy}","received_events_url":"https://api.github.com/users/aws/received_events","type":"Organization","site_admin":false},"repo":{"id":95247959,"name":"aws-sdk-java-v2","full_name":"aws/aws-sdk-java-v2","owner":{"login":"aws","id":2232217,"avatar_url":"https://avatars3.githubusercontent.com/u/2232217?v=4","gravatar_id":"","url":"https://api.github.com/users/aws","html_url":"https://github.com/aws","followers_url":"https://api.github.com/users/aws/followers","following_url":"https://api.github.com/users/aws/following{/other_user}","gists_url":"https://api.github.com/users/aws/gists{/gist_id}","starred_url":"https://api.github.com/users/aws/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aws/subscriptions","organizations_url":"https://api.github.com/users/aws/orgs","repos_url":"https://api.github.com/users/aws/repos","events_url":"https://api.github.com/users/aws/events{/privacy}","received_events_url":"https://api.github.com/users/aws/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/aws/aws-sdk-java-v2","description":"The official AWS SDK for Java - Version 2 (Developer Preview)","fork":false,"url":"https://api.github.com/repos/aws/aws-sdk-java-v2","forks_url":"https://api.github.com/repos/aws/aws-sdk-java-v2/forks","keys_url":"https://api.github.com/repos/aws/aws-sdk-java-v2/keys{/key_id}","collaborators_url":"https://api.github.com/repos/aws/aws-sdk-java-v2/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/aws/aws-sdk-java-v2/teams","hooks_url":"https://api.github.com/repos/aws/aws-sdk-java-v2/hooks","issue_events_url":"https://api.github.com/repos/aws/aws-sdk-java-v2/issues/events{/number}","events_url":"https://api.github.com/repos/aws/aws-sdk-java-v2/events","assignees_url":"https://api.github.com/repos/aws/aws-sdk-java-v2/assignees{/user}","branches_url":"https://api.github.com/repos/aws/aws-sdk-java-v2/branches{/branch}","tags_url":"https://api.github.com/repos/aws/aws-sdk-java-v2/tags","blobs_url":"https://api.github.com/repos/aws/aws-sdk-java-v2/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/aws/aws-sdk-java-v2/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/aws/aws-sdk-java-v2/git/refs{/sha}","trees_url":"https://api.github.com/repos/aws/aws-sdk-java-v2/git/trees{/sha}","statuses_url":"https://api.github.com/repos/aws/aws-sdk-java-v2/statuses/{sha}","languages_url":"https://api.github.com/repos/aws/aws-sdk-java-v2/languages","stargazers_url":"https://api.github.com/repos/aws/aws-sdk-java-v2/stargazers","contributors_url":"https://api.github.com/repos/aws/aws-sdk-java-v2/contributors","subscribers_url":"https://api.github.com/repos/aws/aws-sdk-java-v2/subscribers","subscription_url":"https://api.github.com/repos/aws/aws-sdk-java-v2/subscription","commits_url":"https://api.github.com/repos/aws/aws-sdk-java-v2/commits{/sha}","git_commits_url":"https://api.github.com/repos/aws/aws-sdk-java-v2/git/commits{/sha}","comments_url":"https://api.github.com/repos/aws/aws-sdk-java-v2/comments{/number}","issue_comment_url":"https://api.github.com/repos/aws/aws-sdk-java-v2/issues/comments{/number}","contents_url":"https://api.github.com/repos/aws/aws-sdk-java-v2/contents/{+path}","compare_url":"https://api.github.com/repos/aws/aws-sdk-java-v2/compare/{base}...{head}","merges_url":"https://api.github.com/repos/aws/aws-sdk-java-v2/merges","archive_url":"https://api.github.com/repos/aws/aws-sdk-java-v2/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/aws/aws-sdk-java-v2/downloads","issues_url":"https://api.github.com/repos/aws/aws-sdk-java-v2/issues{/number}","pulls_url":"https://api.github.com/repos/aws/aws-sdk-java-v2/pulls{/number}","milestones_url":"https://api.github.com/repos/aws/aws-sdk-java-v2/milestones{/number}","notifications_url":"https://api.github.com/repos/aws/aws-sdk-java-v2/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/aws/aws-sdk-java-v2/labels{/name}","releases_url":"https://api.github.com/repos/aws/aws-sdk-java-v2/releases{/id}","deployments_url":"https://api.github.com/repos/aws/aws-sdk-java-v2/deployments","created_at":"2017-06-23T18:56:01Z","updated_at":"2017-11-07T20:18:20Z","pushed_at":"2017-11-08T18:14:17Z","git_url":"git://github.com/aws/aws-sdk-java-v2.git","ssh_url":"git@github.com:aws/aws-sdk-java-v2.git","clone_url":"https://github.com/aws/aws-sdk-java-v2.git","svn_url":"https://github.com/aws/aws-sdk-java-v2","homepage":"","size":7449,"stargazers_count":114,"watchers_count":114,"language":"Java","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":28,"mirror_url":null,"archived":false,"open_issues_count":88,"forks":28,"open_issues":88,"watchers":114,"default_branch":"master"}},"base":{"label":"aws:master","ref":"master","sha":"2dcf158b55750c2d74d5cef648bdd8127b356bab","user":{"login":"aws","id":2232217,"avatar_url":"https://avatars3.githubusercontent.com/u/2232217?v=4","gravatar_id":"","url":"https://api.github.com/users/aws","html_url":"https://github.com/aws","followers_url":"https://api.github.com/users/aws/followers","following_url":"https://api.github.com/users/aws/following{/other_user}","gists_url":"https://api.github.com/users/aws/gists{/gist_id}","starred_url":"https://api.github.com/users/aws/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aws/subscriptions","organizations_url":"https://api.github.com/users/aws/orgs","repos_url":"https://api.github.com/users/aws/repos","events_url":"https://api.github.com/users/aws/events{/privacy}","received_events_url":"https://api.github.com/users/aws/received_events","type":"Organization","site_admin":false},"repo":{"id":95247959,"name":"aws-sdk-java-v2","full_name":"aws/aws-sdk-java-v2","owner":{"login":"aws","id":2232217,"avatar_url":"https://avatars3.githubusercontent.com/u/2232217?v=4","gravatar_id":"","url":"https://api.github.com/users/aws","html_url":"https://github.com/aws","followers_url":"https://api.github.com/users/aws/followers","following_url":"https://api.github.com/users/aws/following{/other_user}","gists_url":"https://api.github.com/users/aws/gists{/gist_id}","starred_url":"https://api.github.com/users/aws/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aws/subscriptions","organizations_url":"https://api.github.com/users/aws/orgs","repos_url":"https://api.github.com/users/aws/repos","events_url":"https://api.github.com/users/aws/events{/privacy}","received_events_url":"https://api.github.com/users/aws/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/aws/aws-sdk-java-v2","description":"The official AWS SDK for Java - Version 2 (Developer Preview)","fork":false,"url":"https://api.github.com/repos/aws/aws-sdk-java-v2","forks_url":"https://api.github.com/repos/aws/aws-sdk-java-v2/forks","keys_url":"https://api.github.com/repos/aws/aws-sdk-java-v2/keys{/key_id}","collaborators_url":"https://api.github.com/repos/aws/aws-sdk-java-v2/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/aws/aws-sdk-java-v2/teams","hooks_url":"https://api.github.com/repos/aws/aws-sdk-java-v2/hooks","issue_events_url":"https://api.github.com/repos/aws/aws-sdk-java-v2/issues/events{/number}","events_url":"https://api.github.com/repos/aws/aws-sdk-java-v2/events","assignees_url":"https://api.github.com/repos/aws/aws-sdk-java-v2/assignees{/user}","branches_url":"https://api.github.com/repos/aws/aws-sdk-java-v2/branches{/branch}","tags_url":"https://api.github.com/repos/aws/aws-sdk-java-v2/tags","blobs_url":"https://api.github.com/repos/aws/aws-sdk-java-v2/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/aws/aws-sdk-java-v2/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/aws/aws-sdk-java-v2/git/refs{/sha}","trees_url":"https://api.github.com/repos/aws/aws-sdk-java-v2/git/trees{/sha}","statuses_url":"https://api.github.com/repos/aws/aws-sdk-java-v2/statuses/{sha}","languages_url":"https://api.github.com/repos/aws/aws-sdk-java-v2/languages","stargazers_url":"https://api.github.com/repos/aws/aws-sdk-java-v2/stargazers","contributors_url":"https://api.github.com/repos/aws/aws-sdk-java-v2/contributors","subscribers_url":"https://api.github.com/repos/aws/aws-sdk-java-v2/subscribers","subscription_url":"https://api.github.com/repos/aws/aws-sdk-java-v2/subscription","commits_url":"https://api.github.com/repos/aws/aws-sdk-java-v2/commits{/sha}","git_commits_url":"https://api.github.com/repos/aws/aws-sdk-java-v2/git/commits{/sha}","comments_url":"https://api.github.com/repos/aws/aws-sdk-java-v2/comments{/number}","issue_comment_url":"https://api.github.com/repos/aws/aws-sdk-java-v2/issues/comments{/number}","contents_url":"https://api.github.com/repos/aws/aws-sdk-java-v2/contents/{+path}","compare_url":"https://api.github.com/repos/aws/aws-sdk-java-v2/compare/{base}...{head}","merges_url":"https://api.github.com/repos/aws/aws-sdk-java-v2/merges","archive_url":"https://api.github.com/repos/aws/aws-sdk-java-v2/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/aws/aws-sdk-java-v2/downloads","issues_url":"https://api.github.com/repos/aws/aws-sdk-java-v2/issues{/number}","pulls_url":"https://api.github.com/repos/aws/aws-sdk-java-v2/pulls{/number}","milestones_url":"https://api.github.com/repos/aws/aws-sdk-java-v2/milestones{/number}","notifications_url":"https://api.github.com/repos/aws/aws-sdk-java-v2/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/aws/aws-sdk-java-v2/labels{/name}","releases_url":"https://api.github.com/repos/aws/aws-sdk-java-v2/releases{/id}","deployments_url":"https://api.github.com/repos/aws/aws-sdk-java-v2/deployments","created_at":"2017-06-23T18:56:01Z","updated_at":"2017-11-07T20:18:20Z","pushed_at":"2017-11-08T18:14:17Z","git_url":"git://github.com/aws/aws-sdk-java-v2.git","ssh_url":"git@github.com:aws/aws-sdk-java-v2.git","clone_url":"https://github.com/aws/aws-sdk-java-v2.git","svn_url":"https://github.com/aws/aws-sdk-java-v2","homepage":"","size":7449,"stargazers_count":114,"watchers_count":114,"language":"Java","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":28,"mirror_url":null,"archived":false,"open_issues_count":88,"forks":28,"open_issues":88,"watchers":114,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/aws/aws-sdk-java-v2/pulls/276"},"html":{"href":"https://github.com/aws/aws-sdk-java-v2/pull/276"},"issue":{"href":"https://api.github.com/repos/aws/aws-sdk-java-v2/issues/276"},"comments":{"href":"https://api.github.com/repos/aws/aws-sdk-java-v2/issues/276/comments"},"review_comments":{"href":"https://api.github.com/repos/aws/aws-sdk-java-v2/pulls/276/comments"},"review_comment":{"href":"https://api.github.com/repos/aws/aws-sdk-java-v2/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/aws/aws-sdk-java-v2/pulls/276/commits"},"statuses":{"href":"https://api.github.com/repos/aws/aws-sdk-java-v2/statuses/0077f17d5725b72d30c8cb5fd3a08f68d288c610"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"millems"}}