{"action":"created","issue":{"url":"https://api.github.com/repos/sockeqwe/fragmentargs/issues/25","labels_url":"https://api.github.com/repos/sockeqwe/fragmentargs/issues/25/labels{/name}","comments_url":"https://api.github.com/repos/sockeqwe/fragmentargs/issues/25/comments","events_url":"https://api.github.com/repos/sockeqwe/fragmentargs/issues/25/events","html_url":"https://github.com/sockeqwe/fragmentargs/issues/25","id":92845553,"number":25,"title":"Keep arguments order as declared","user":{"login":"Yarikx","id":184247,"avatar_url":"https://avatars.githubusercontent.com/u/184247?v=3","gravatar_id":"","url":"https://api.github.com/users/Yarikx","html_url":"https://github.com/Yarikx","followers_url":"https://api.github.com/users/Yarikx/followers","following_url":"https://api.github.com/users/Yarikx/following{/other_user}","gists_url":"https://api.github.com/users/Yarikx/gists{/gist_id}","starred_url":"https://api.github.com/users/Yarikx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Yarikx/subscriptions","organizations_url":"https://api.github.com/users/Yarikx/orgs","repos_url":"https://api.github.com/users/Yarikx/repos","events_url":"https://api.github.com/users/Yarikx/events{/privacy}","received_events_url":"https://api.github.com/users/Yarikx/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/sockeqwe/fragmentargs/labels/enhancement","name":"enhancement","color":"84b6eb"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":13,"created_at":"2015-07-03T10:29:37Z","updated_at":"2015-11-10T14:40:31Z","closed_at":null,"body":"Sometimes when there 2 or more required arguments, the order of generated builder constructor parameters differs from the order of it's declaration in fragment.\r\nThis is specially annoying when Fragment has 2 or more same type args (like String, String, String),\r\nso you forced to build and generate Builder, just to identify arguments order."},"comment":{"url":"https://api.github.com/repos/sockeqwe/fragmentargs/issues/comments/155437545","html_url":"https://github.com/sockeqwe/fragmentargs/issues/25#issuecomment-155437545","issue_url":"https://api.github.com/repos/sockeqwe/fragmentargs/issues/25","id":155437545,"user":{"login":"themadhukiran","id":2976579,"avatar_url":"https://avatars.githubusercontent.com/u/2976579?v=3","gravatar_id":"","url":"https://api.github.com/users/themadhukiran","html_url":"https://github.com/themadhukiran","followers_url":"https://api.github.com/users/themadhukiran/followers","following_url":"https://api.github.com/users/themadhukiran/following{/other_user}","gists_url":"https://api.github.com/users/themadhukiran/gists{/gist_id}","starred_url":"https://api.github.com/users/themadhukiran/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/themadhukiran/subscriptions","organizations_url":"https://api.github.com/users/themadhukiran/orgs","repos_url":"https://api.github.com/users/themadhukiran/repos","events_url":"https://api.github.com/users/themadhukiran/events{/privacy}","received_events_url":"https://api.github.com/users/themadhukiran/received_events","type":"User","site_admin":false},"created_at":"2015-11-10T14:40:31Z","updated_at":"2015-11-10T14:40:31Z","body":"Actually I think it's possible to get the order in which the fields are declared. Instead of getting the elements annotated with `@Arg` directly, if we obtain the element annotated with `@FragmentWithArgs` and use `getEnclosedElements()` it returns the elements in the order defined in the Class. \r\nThat's what I understood from this [documentation](https://docs.oracle.com/javase/7/docs/api/javax/lang/model/element/TypeElement.html#getEnclosedElements())\r\nThe we can check if the element has `@Arg` annotation. \r\n\r\nI suppose there might be some overhead using this approach if the file is very big and has many elements. "}}