{"action":"created","issue":{"url":"https://api.github.com/repos/segmentio/analytics-android/issues/399","labels_url":"https://api.github.com/repos/segmentio/analytics-android/issues/399/labels{/name}","comments_url":"https://api.github.com/repos/segmentio/analytics-android/issues/399/comments","events_url":"https://api.github.com/repos/segmentio/analytics-android/issues/399/events","html_url":"https://github.com/segmentio/analytics-android/issues/399","id":121320641,"number":399,"title":"Why does `put` return `Object` where `putEmail` returns Trait?","user":{"login":"FreakTheMighty","id":247092,"avatar_url":"https://avatars.githubusercontent.com/u/247092?v=3","gravatar_id":"","url":"https://api.github.com/users/FreakTheMighty","html_url":"https://github.com/FreakTheMighty","followers_url":"https://api.github.com/users/FreakTheMighty/followers","following_url":"https://api.github.com/users/FreakTheMighty/following{/other_user}","gists_url":"https://api.github.com/users/FreakTheMighty/gists{/gist_id}","starred_url":"https://api.github.com/users/FreakTheMighty/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/FreakTheMighty/subscriptions","organizations_url":"https://api.github.com/users/FreakTheMighty/orgs","repos_url":"https://api.github.com/users/FreakTheMighty/repos","events_url":"https://api.github.com/users/FreakTheMighty/events{/privacy}","received_events_url":"https://api.github.com/users/FreakTheMighty/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-12-09T19:29:09Z","updated_at":"2015-12-10T05:06:00Z","closed_at":"2015-12-10T05:06:00Z","body":"It seems odd that `putEmail`, `putFirstName` etc, returns a `Traits`, instance, but `put` returns `Object`. This makes it so that we can't chain with `put`. For example, this doesn't work.\r\n```Java\r\nnew Traits().put(\"custom\", \"value\").putFirstName(\"first\").putLastName(\"last\");\r\n```"},"comment":{"url":"https://api.github.com/repos/segmentio/analytics-android/issues/comments/163488460","html_url":"https://github.com/segmentio/analytics-android/issues/399#issuecomment-163488460","issue_url":"https://api.github.com/repos/segmentio/analytics-android/issues/399","id":163488460,"user":{"login":"f2prateek","id":843979,"avatar_url":"https://avatars.githubusercontent.com/u/843979?v=3","gravatar_id":"","url":"https://api.github.com/users/f2prateek","html_url":"https://github.com/f2prateek","followers_url":"https://api.github.com/users/f2prateek/followers","following_url":"https://api.github.com/users/f2prateek/following{/other_user}","gists_url":"https://api.github.com/users/f2prateek/gists{/gist_id}","starred_url":"https://api.github.com/users/f2prateek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/f2prateek/subscriptions","organizations_url":"https://api.github.com/users/f2prateek/orgs","repos_url":"https://api.github.com/users/f2prateek/repos","events_url":"https://api.github.com/users/f2prateek/events{/privacy}","received_events_url":"https://api.github.com/users/f2prateek/received_events","type":"User","site_admin":false},"created_at":"2015-12-10T05:06:00Z","updated_at":"2015-12-10T05:06:00Z","body":"`put` is a method defined by the [map interface](http://docs.oracle.com/javase/7/docs/api/java/util/Map.html#put(K,%20V)), which by contract is meant to return the previously defined value for the given key. We can't just change it return whatever we want.\r\n\r\nThere's a method called `putValue` that does what you're looking for."}}