{"action":"created","issue":{"url":"https://api.github.com/repos/yegor256/cactoos/issues/37","repository_url":"https://api.github.com/repos/yegor256/cactoos","labels_url":"https://api.github.com/repos/yegor256/cactoos/issues/37/labels{/name}","comments_url":"https://api.github.com/repos/yegor256/cactoos/issues/37/comments","events_url":"https://api.github.com/repos/yegor256/cactoos/issues/37/events","html_url":"https://github.com/yegor256/cactoos/issues/37","id":231669254,"number":37,"title":"Interaction with JDK entities","user":{"login":"englishman","id":1883572,"avatar_url":"https://avatars0.githubusercontent.com/u/1883572?v=3","gravatar_id":"","url":"https://api.github.com/users/englishman","html_url":"https://github.com/englishman","followers_url":"https://api.github.com/users/englishman/followers","following_url":"https://api.github.com/users/englishman/following{/other_user}","gists_url":"https://api.github.com/users/englishman/gists{/gist_id}","starred_url":"https://api.github.com/users/englishman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/englishman/subscriptions","organizations_url":"https://api.github.com/users/englishman/orgs","repos_url":"https://api.github.com/users/englishman/repos","events_url":"https://api.github.com/users/englishman/events{/privacy}","received_events_url":"https://api.github.com/users/englishman/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":8,"created_at":"2017-05-26T16:04:59Z","updated_at":"2017-05-28T08:22:04Z","closed_at":null,"body":"**Cactoos** intention, AFAIU, is to be a library (not a framework). So we have an issue with standard JDK entities interaction (strings, java statements, JDK functions etc.)\r\n\r\nHere are 2 points: consuming some JDK entity and producing an entity to JDK.\r\n\r\nThe way for entity consuming shows [StringAsText.java](https://github.com/yegor256/cactoos/blob/master/src/main/java/org/cactoos/text/StringAsText.java) adapter. It adapts `java.lang.String` into `org.cactoos.Text`. So if we wanna use `org.cactoos.text.UpperText` we have to write\r\n```\r\nnew UpperText(new StringAsText(\"java string\"))\r\n```\r\n\r\nThe way for producing shows [Scalar.java](https://github.com/yegor256/cactoos/blob/master/src/main/java/org/cactoos/Scalar.java) interface with it's `asValue` method. E.g. `LengthOfIterable` implements `Scalar<Integer>` and should be used as\r\n```\r\nint length = new LengthOfIterable(...).asValue();\r\n```\r\nor\r\n```\r\nif (new IsBlank(new StringAsText(\"java string\")).asValue()) {\r\n...\r\n}\r\n```\r\n_For me the both producing and consuming look a bit cumbersome and verbose. Is there any way to make JDK interaction smoothly?_ \r\n\r\nE.g. `java.lang.CharSequence` interface might be used instead of `org.cactoos.Text` and then string consuming might be looks like \r\n```\r\nnew UpperText(\"some java literal\")\r\n```\r\nas `java.lang.String` already implements `java.lang.CharSequence` interface.\r\n\r\nAlso, `java.lang.Number` can be used as superclass of scalar values.  However, instead of `CharSequence` interface `Number` is an abstract class and, thus, less helpful.\r\n\r\nWDYT?"},"comment":{"url":"https://api.github.com/repos/yegor256/cactoos/issues/comments/304500128","html_url":"https://github.com/yegor256/cactoos/issues/37#issuecomment-304500128","issue_url":"https://api.github.com/repos/yegor256/cactoos/issues/37","id":304500128,"user":{"login":"VsSekorin","id":9549360,"avatar_url":"https://avatars2.githubusercontent.com/u/9549360?v=3","gravatar_id":"","url":"https://api.github.com/users/VsSekorin","html_url":"https://github.com/VsSekorin","followers_url":"https://api.github.com/users/VsSekorin/followers","following_url":"https://api.github.com/users/VsSekorin/following{/other_user}","gists_url":"https://api.github.com/users/VsSekorin/gists{/gist_id}","starred_url":"https://api.github.com/users/VsSekorin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/VsSekorin/subscriptions","organizations_url":"https://api.github.com/users/VsSekorin/orgs","repos_url":"https://api.github.com/users/VsSekorin/repos","events_url":"https://api.github.com/users/VsSekorin/events{/privacy}","received_events_url":"https://api.github.com/users/VsSekorin/received_events","type":"User","site_admin":false},"created_at":"2017-05-28T08:22:04Z","updated_at":"2017-05-28T08:22:04Z","body":"@fabriciofx What about [Constructors Must Be Code-Free](http://www.yegor256.com/2015/05/07/ctors-must-be-code-free.html)? I'm not sure that this is the right solution."}}
{"actor":{"display_login":"VsSekorin"}}