{"action":"created","issue":{"url":"https://api.github.com/repos/OpenGamma/Strata/issues/797","repository_url":"https://api.github.com/repos/OpenGamma/Strata","labels_url":"https://api.github.com/repos/OpenGamma/Strata/issues/797/labels{/name}","comments_url":"https://api.github.com/repos/OpenGamma/Strata/issues/797/comments","events_url":"https://api.github.com/repos/OpenGamma/Strata/issues/797/events","html_url":"https://github.com/OpenGamma/Strata/pull/797","id":135691256,"number":797,"title":"Replace containsValue with findValue on market data containers","user":{"login":"cjkent","id":98477,"avatar_url":"https://avatars.githubusercontent.com/u/98477?v=3","gravatar_id":"","url":"https://api.github.com/users/cjkent","html_url":"https://github.com/cjkent","followers_url":"https://api.github.com/users/cjkent/followers","following_url":"https://api.github.com/users/cjkent/following{/other_user}","gists_url":"https://api.github.com/users/cjkent/gists{/gist_id}","starred_url":"https://api.github.com/users/cjkent/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cjkent/subscriptions","organizations_url":"https://api.github.com/users/cjkent/orgs","repos_url":"https://api.github.com/users/cjkent/repos","events_url":"https://api.github.com/users/cjkent/events{/privacy}","received_events_url":"https://api.github.com/users/cjkent/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/OpenGamma/Strata/labels/Status:InReview","name":"Status:InReview","color":"fad8c7"},{"url":"https://api.github.com/repos/OpenGamma/Strata/labels/Type:Enhancement","name":"Type:Enhancement","color":"006b75"}],"state":"open","locked":false,"assignee":{"login":"jodastephen","id":213212,"avatar_url":"https://avatars.githubusercontent.com/u/213212?v=3","gravatar_id":"","url":"https://api.github.com/users/jodastephen","html_url":"https://github.com/jodastephen","followers_url":"https://api.github.com/users/jodastephen/followers","following_url":"https://api.github.com/users/jodastephen/following{/other_user}","gists_url":"https://api.github.com/users/jodastephen/gists{/gist_id}","starred_url":"https://api.github.com/users/jodastephen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jodastephen/subscriptions","organizations_url":"https://api.github.com/users/jodastephen/orgs","repos_url":"https://api.github.com/users/jodastephen/repos","events_url":"https://api.github.com/users/jodastephen/events{/privacy}","received_events_url":"https://api.github.com/users/jodastephen/received_events","type":"User","site_admin":false},"milestone":null,"comments":2,"created_at":"2016-02-23T10:03:45Z","updated_at":"2016-02-23T10:41:17Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/OpenGamma/Strata/pulls/797","html_url":"https://github.com/OpenGamma/Strata/pull/797","diff_url":"https://github.com/OpenGamma/Strata/pull/797.diff","patch_url":"https://github.com/OpenGamma/Strata/pull/797.patch"},"body":"Replace the boolean-returning `containsValue` methods on the market data containers with `findValue` returning an `Optional`. This is more consistent with the approach elsewhere in the codebase, and it gets rid of the need for two map lookups in the cases where a call to `containsValue` is immediately followed by a call to `getValue`.\r\n\r\nThe `containsTimeSeries` method has been removed. Originally the behaviour of `getTimeSeries` was the same as `getValue` in that it threw an exception if there was no data available. That was changed so `getTimeSeries` returns an empty series if no data is available. That made `containsTimeSeries` redundant, but it wasn't removed at the time."},"comment":{"url":"https://api.github.com/repos/OpenGamma/Strata/issues/comments/187647271","html_url":"https://github.com/OpenGamma/Strata/pull/797#issuecomment-187647271","issue_url":"https://api.github.com/repos/OpenGamma/Strata/issues/797","id":187647271,"user":{"login":"cjkent","id":98477,"avatar_url":"https://avatars.githubusercontent.com/u/98477?v=3","gravatar_id":"","url":"https://api.github.com/users/cjkent","html_url":"https://github.com/cjkent","followers_url":"https://api.github.com/users/cjkent/followers","following_url":"https://api.github.com/users/cjkent/following{/other_user}","gists_url":"https://api.github.com/users/cjkent/gists{/gist_id}","starred_url":"https://api.github.com/users/cjkent/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cjkent/subscriptions","organizations_url":"https://api.github.com/users/cjkent/orgs","repos_url":"https://api.github.com/users/cjkent/repos","events_url":"https://api.github.com/users/cjkent/events{/privacy}","received_events_url":"https://api.github.com/users/cjkent/received_events","type":"User","site_admin":false},"created_at":"2016-02-23T10:41:16Z","updated_at":"2016-02-23T10:41:16Z","body":"I don't think there's any debate around removing `containsTimeSeries`. It makes no sense where `getTimeSeries` returns an empty series for an unknown ID.\r\n\r\nHaving `containsValue` is inconsistent with the approach elsewhere. It was a performance issue that made me consider removing it; calling `containsValue` followed by `getValue` is two map lookups. `findValue` trades a lookup for the cost of putting the value in an `Optional`.\r\n\r\nIf we find it's a problem it's trivial to add `containsValue`. But we can't easily remove it later and it adds API surface area."}}