{"action":"opened","issue":{"url":"https://api.github.com/repos/restx/restx/issues/212","labels_url":"https://api.github.com/repos/restx/restx/issues/212/labels{/name}","comments_url":"https://api.github.com/repos/restx/restx/issues/212/comments","events_url":"https://api.github.com/repos/restx/restx/issues/212/events","html_url":"https://github.com/restx/restx/issues/212","id":98162561,"number":212,"title":"Conditional components enhancements","user":{"login":"a-peyrard","id":6125316,"avatar_url":"https://avatars.githubusercontent.com/u/6125316?v=3","gravatar_id":"","url":"https://api.github.com/users/a-peyrard","html_url":"https://github.com/a-peyrard","followers_url":"https://api.github.com/users/a-peyrard/followers","following_url":"https://api.github.com/users/a-peyrard/following{/other_user}","gists_url":"https://api.github.com/users/a-peyrard/gists{/gist_id}","starred_url":"https://api.github.com/users/a-peyrard/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/a-peyrard/subscriptions","organizations_url":"https://api.github.com/users/a-peyrard/orgs","repos_url":"https://api.github.com/users/a-peyrard/repos","events_url":"https://api.github.com/users/a-peyrard/events{/privacy}","received_events_url":"https://api.github.com/users/a-peyrard/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/restx/restx/labels/enhancement","name":"enhancement","color":"84b6eb"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-07-30T12:54:37Z","updated_at":"2015-07-30T12:54:37Z","closed_at":null,"body":"Currently we are able to create conditional components, based on the value of a property, like this:\r\n```java\r\n@Provides\r\n@When(name = \"property\", value = \"theValue\")\r\npublic MyComponent myComponent() {\r\n  return new MyComponent();\r\n}\r\n``` \r\n\r\nWith Xavier some month ago we were talking about a reversed annotation, `@Unless`. And since we talked about this, I came across several cases where I could have used this annotation.\r\n\r\nFor me there is also another missing thing. Be able to provides a component only if a property exist (whatever its value). I think it could look like this:\r\n```java\r\n@Provides\r\n@WhenDefined(name = \"property\")\r\npublic MyComponent myComponent() {\r\n  return new MyComponent();\r\n}\r\n``` \r\n\r\nWDYT ?\r\n"}}