{"action":"closed","number":4,"pull_request":{"url":"https://api.github.com/repos/facebook/device-year-class/pulls/4","id":32175888,"html_url":"https://github.com/facebook/device-year-class/pull/4","diff_url":"https://github.com/facebook/device-year-class/pull/4.diff","patch_url":"https://github.com/facebook/device-year-class/pull/4.patch","issue_url":"https://api.github.com/repos/facebook/device-year-class/issues/4","number":4,"state":"closed","locked":false,"title":"Change YearClass to an enum and use Character.isDigit()","user":{"login":"trevor-e","id":1447798,"avatar_url":"https://avatars.githubusercontent.com/u/1447798?v=3","gravatar_id":"","url":"https://api.github.com/users/trevor-e","html_url":"https://github.com/trevor-e","followers_url":"https://api.github.com/users/trevor-e/followers","following_url":"https://api.github.com/users/trevor-e/following{/other_user}","gists_url":"https://api.github.com/users/trevor-e/gists{/gist_id}","starred_url":"https://api.github.com/users/trevor-e/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/trevor-e/subscriptions","organizations_url":"https://api.github.com/users/trevor-e/orgs","repos_url":"https://api.github.com/users/trevor-e/repos","events_url":"https://api.github.com/users/trevor-e/events{/privacy}","received_events_url":"https://api.github.com/users/trevor-e/received_events","type":"User","site_admin":false},"body":"I like the lib, simple yet useful! While poking through it I noticed manual checks against '0' and '9' rather than using Character.isDigit().  That was an easy fix and seems to work the same.\r\n\r\nNext, one thing that bugged me is YearClass masquerading as an enum and not actually being one.  I refactored it into an enum which wasn't too hard, allowing me to get rid of all the public static constants.  I preserved the int value so that you can still save it to SharedPreference, though it *could* be removed in favor of the ordinal value.  It does feel a bit awkward having a get(Context) method sitting in an enum, and I suppose I could push the enum to an inner class and make YearClass a wrapper.  I think it's fine how it is since it's a tighter structure, but I'll do it if someone wants me to.\r\n\r\nHow do I run the tests?  I tried running with `./gradlew test' and nothing seemed to run.  I would recommend upgrading to the 1.1 gradle plugin and using the Android Studio unit test support.","created_at":"2015-03-29T03:36:56Z","updated_at":"2015-09-03T14:48:22Z","closed_at":"2015-09-03T14:48:22Z","merged_at":"2015-09-03T14:48:22Z","merge_commit_sha":"70730fcb4d4ed2da2d457ba0b0944c011543efbd","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/facebook/device-year-class/pulls/4/commits","review_comments_url":"https://api.github.com/repos/facebook/device-year-class/pulls/4/comments","review_comment_url":"https://api.github.com/repos/facebook/device-year-class/pulls/comments{/number}","comments_url":"https://api.github.com/repos/facebook/device-year-class/issues/4/comments","statuses_url":"https://api.github.com/repos/facebook/device-year-class/statuses/20a780122e51afefef306d510b42f41938e63da5","head":{"label":"trevor-e:master","ref":"master","sha":"20a780122e51afefef306d510b42f41938e63da5","user":{"login":"trevor-e","id":1447798,"avatar_url":"https://avatars.githubusercontent.com/u/1447798?v=3","gravatar_id":"","url":"https://api.github.com/users/trevor-e","html_url":"https://github.com/trevor-e","followers_url":"https://api.github.com/users/trevor-e/followers","following_url":"https://api.github.com/users/trevor-e/following{/other_user}","gists_url":"https://api.github.com/users/trevor-e/gists{/gist_id}","starred_url":"https://api.github.com/users/trevor-e/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/trevor-e/subscriptions","organizations_url":"https://api.github.com/users/trevor-e/orgs","repos_url":"https://api.github.com/users/trevor-e/repos","events_url":"https://api.github.com/users/trevor-e/events{/privacy}","received_events_url":"https://api.github.com/users/trevor-e/received_events","type":"User","site_admin":false},"repo":{"id":33024178,"name":"device-year-class","full_name":"trevor-e/device-year-class","owner":{"login":"trevor-e","id":1447798,"avatar_url":"https://avatars.githubusercontent.com/u/1447798?v=3","gravatar_id":"","url":"https://api.github.com/users/trevor-e","html_url":"https://github.com/trevor-e","followers_url":"https://api.github.com/users/trevor-e/followers","following_url":"https://api.github.com/users/trevor-e/following{/other_user}","gists_url":"https://api.github.com/users/trevor-e/gists{/gist_id}","starred_url":"https://api.github.com/users/trevor-e/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/trevor-e/subscriptions","organizations_url":"https://api.github.com/users/trevor-e/orgs","repos_url":"https://api.github.com/users/trevor-e/repos","events_url":"https://api.github.com/users/trevor-e/events{/privacy}","received_events_url":"https://api.github.com/users/trevor-e/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/trevor-e/device-year-class","description":"A library that analyzes an Android device's specifications and calculates which year the device would be considered \"high end”.","fork":true,"url":"https://api.github.com/repos/trevor-e/device-year-class","forks_url":"https://api.github.com/repos/trevor-e/device-year-class/forks","keys_url":"https://api.github.com/repos/trevor-e/device-year-class/keys{/key_id}","collaborators_url":"https://api.github.com/repos/trevor-e/device-year-class/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/trevor-e/device-year-class/teams","hooks_url":"https://api.github.com/repos/trevor-e/device-year-class/hooks","issue_events_url":"https://api.github.com/repos/trevor-e/device-year-class/issues/events{/number}","events_url":"https://api.github.com/repos/trevor-e/device-year-class/events","assignees_url":"https://api.github.com/repos/trevor-e/device-year-class/assignees{/user}","branches_url":"https://api.github.com/repos/trevor-e/device-year-class/branches{/branch}","tags_url":"https://api.github.com/repos/trevor-e/device-year-class/tags","blobs_url":"https://api.github.com/repos/trevor-e/device-year-class/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/trevor-e/device-year-class/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/trevor-e/device-year-class/git/refs{/sha}","trees_url":"https://api.github.com/repos/trevor-e/device-year-class/git/trees{/sha}","statuses_url":"https://api.github.com/repos/trevor-e/device-year-class/statuses/{sha}","languages_url":"https://api.github.com/repos/trevor-e/device-year-class/languages","stargazers_url":"https://api.github.com/repos/trevor-e/device-year-class/stargazers","contributors_url":"https://api.github.com/repos/trevor-e/device-year-class/contributors","subscribers_url":"https://api.github.com/repos/trevor-e/device-year-class/subscribers","subscription_url":"https://api.github.com/repos/trevor-e/device-year-class/subscription","commits_url":"https://api.github.com/repos/trevor-e/device-year-class/commits{/sha}","git_commits_url":"https://api.github.com/repos/trevor-e/device-year-class/git/commits{/sha}","comments_url":"https://api.github.com/repos/trevor-e/device-year-class/comments{/number}","issue_comment_url":"https://api.github.com/repos/trevor-e/device-year-class/issues/comments{/number}","contents_url":"https://api.github.com/repos/trevor-e/device-year-class/contents/{+path}","compare_url":"https://api.github.com/repos/trevor-e/device-year-class/compare/{base}...{head}","merges_url":"https://api.github.com/repos/trevor-e/device-year-class/merges","archive_url":"https://api.github.com/repos/trevor-e/device-year-class/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/trevor-e/device-year-class/downloads","issues_url":"https://api.github.com/repos/trevor-e/device-year-class/issues{/number}","pulls_url":"https://api.github.com/repos/trevor-e/device-year-class/pulls{/number}","milestones_url":"https://api.github.com/repos/trevor-e/device-year-class/milestones{/number}","notifications_url":"https://api.github.com/repos/trevor-e/device-year-class/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/trevor-e/device-year-class/labels{/name}","releases_url":"https://api.github.com/repos/trevor-e/device-year-class/releases{/id}","created_at":"2015-03-28T06:58:55Z","updated_at":"2015-03-29T02:30:04Z","pushed_at":"2015-03-29T02:30:04Z","git_url":"git://github.com/trevor-e/device-year-class.git","ssh_url":"git@github.com:trevor-e/device-year-class.git","clone_url":"https://github.com/trevor-e/device-year-class.git","svn_url":"https://github.com/trevor-e/device-year-class","homepage":"","size":501,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"facebook:master","ref":"master","sha":"ceb76476000ed401fc147eda2c1863479d3a11ca","user":{"login":"facebook","id":69631,"avatar_url":"https://avatars.githubusercontent.com/u/69631?v=3","gravatar_id":"","url":"https://api.github.com/users/facebook","html_url":"https://github.com/facebook","followers_url":"https://api.github.com/users/facebook/followers","following_url":"https://api.github.com/users/facebook/following{/other_user}","gists_url":"https://api.github.com/users/facebook/gists{/gist_id}","starred_url":"https://api.github.com/users/facebook/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/facebook/subscriptions","organizations_url":"https://api.github.com/users/facebook/orgs","repos_url":"https://api.github.com/users/facebook/repos","events_url":"https://api.github.com/users/facebook/events{/privacy}","received_events_url":"https://api.github.com/users/facebook/received_events","type":"Organization","site_admin":false},"repo":{"id":31786762,"name":"device-year-class","full_name":"facebook/device-year-class","owner":{"login":"facebook","id":69631,"avatar_url":"https://avatars.githubusercontent.com/u/69631?v=3","gravatar_id":"","url":"https://api.github.com/users/facebook","html_url":"https://github.com/facebook","followers_url":"https://api.github.com/users/facebook/followers","following_url":"https://api.github.com/users/facebook/following{/other_user}","gists_url":"https://api.github.com/users/facebook/gists{/gist_id}","starred_url":"https://api.github.com/users/facebook/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/facebook/subscriptions","organizations_url":"https://api.github.com/users/facebook/orgs","repos_url":"https://api.github.com/users/facebook/repos","events_url":"https://api.github.com/users/facebook/events{/privacy}","received_events_url":"https://api.github.com/users/facebook/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/facebook/device-year-class","description":"A library that analyzes an Android device's specifications and calculates which year the device would be considered \"high end”.","fork":false,"url":"https://api.github.com/repos/facebook/device-year-class","forks_url":"https://api.github.com/repos/facebook/device-year-class/forks","keys_url":"https://api.github.com/repos/facebook/device-year-class/keys{/key_id}","collaborators_url":"https://api.github.com/repos/facebook/device-year-class/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/facebook/device-year-class/teams","hooks_url":"https://api.github.com/repos/facebook/device-year-class/hooks","issue_events_url":"https://api.github.com/repos/facebook/device-year-class/issues/events{/number}","events_url":"https://api.github.com/repos/facebook/device-year-class/events","assignees_url":"https://api.github.com/repos/facebook/device-year-class/assignees{/user}","branches_url":"https://api.github.com/repos/facebook/device-year-class/branches{/branch}","tags_url":"https://api.github.com/repos/facebook/device-year-class/tags","blobs_url":"https://api.github.com/repos/facebook/device-year-class/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/facebook/device-year-class/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/facebook/device-year-class/git/refs{/sha}","trees_url":"https://api.github.com/repos/facebook/device-year-class/git/trees{/sha}","statuses_url":"https://api.github.com/repos/facebook/device-year-class/statuses/{sha}","languages_url":"https://api.github.com/repos/facebook/device-year-class/languages","stargazers_url":"https://api.github.com/repos/facebook/device-year-class/stargazers","contributors_url":"https://api.github.com/repos/facebook/device-year-class/contributors","subscribers_url":"https://api.github.com/repos/facebook/device-year-class/subscribers","subscription_url":"https://api.github.com/repos/facebook/device-year-class/subscription","commits_url":"https://api.github.com/repos/facebook/device-year-class/commits{/sha}","git_commits_url":"https://api.github.com/repos/facebook/device-year-class/git/commits{/sha}","comments_url":"https://api.github.com/repos/facebook/device-year-class/comments{/number}","issue_comment_url":"https://api.github.com/repos/facebook/device-year-class/issues/comments{/number}","contents_url":"https://api.github.com/repos/facebook/device-year-class/contents/{+path}","compare_url":"https://api.github.com/repos/facebook/device-year-class/compare/{base}...{head}","merges_url":"https://api.github.com/repos/facebook/device-year-class/merges","archive_url":"https://api.github.com/repos/facebook/device-year-class/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/facebook/device-year-class/downloads","issues_url":"https://api.github.com/repos/facebook/device-year-class/issues{/number}","pulls_url":"https://api.github.com/repos/facebook/device-year-class/pulls{/number}","milestones_url":"https://api.github.com/repos/facebook/device-year-class/milestones{/number}","notifications_url":"https://api.github.com/repos/facebook/device-year-class/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/facebook/device-year-class/labels{/name}","releases_url":"https://api.github.com/repos/facebook/device-year-class/releases{/id}","created_at":"2015-03-06T20:06:07Z","updated_at":"2015-09-02T00:44:01Z","pushed_at":"2015-09-03T14:48:22Z","git_url":"git://github.com/facebook/device-year-class.git","ssh_url":"git@github.com:facebook/device-year-class.git","clone_url":"https://github.com/facebook/device-year-class.git","svn_url":"https://github.com/facebook/device-year-class","homepage":"","size":919,"stargazers_count":972,"watchers_count":972,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":83,"mirror_url":null,"open_issues_count":1,"forks":83,"open_issues":1,"watchers":972,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/facebook/device-year-class/pulls/4"},"html":{"href":"https://github.com/facebook/device-year-class/pull/4"},"issue":{"href":"https://api.github.com/repos/facebook/device-year-class/issues/4"},"comments":{"href":"https://api.github.com/repos/facebook/device-year-class/issues/4/comments"},"review_comments":{"href":"https://api.github.com/repos/facebook/device-year-class/pulls/4/comments"},"review_comment":{"href":"https://api.github.com/repos/facebook/device-year-class/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/facebook/device-year-class/pulls/4/commits"},"statuses":{"href":"https://api.github.com/repos/facebook/device-year-class/statuses/20a780122e51afefef306d510b42f41938e63da5"}},"merged":true,"mergeable":null,"mergeable_state":"unknown","merged_by":{"login":"SeyelentEco","id":727900,"avatar_url":"https://avatars.githubusercontent.com/u/727900?v=3","gravatar_id":"","url":"https://api.github.com/users/SeyelentEco","html_url":"https://github.com/SeyelentEco","followers_url":"https://api.github.com/users/SeyelentEco/followers","following_url":"https://api.github.com/users/SeyelentEco/following{/other_user}","gists_url":"https://api.github.com/users/SeyelentEco/gists{/gist_id}","starred_url":"https://api.github.com/users/SeyelentEco/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SeyelentEco/subscriptions","organizations_url":"https://api.github.com/users/SeyelentEco/orgs","repos_url":"https://api.github.com/users/SeyelentEco/repos","events_url":"https://api.github.com/users/SeyelentEco/events{/privacy}","received_events_url":"https://api.github.com/users/SeyelentEco/received_events","type":"User","site_admin":false},"comments":3,"review_comments":0,"commits":4,"additions":114,"deletions":81,"changed_files":4}}