Pandemic Posted October 28, 2014 Share Posted October 28, 2014 Boolean.toString(true) and Boolean.parseBoolean("true")? Link to comment
NotoriousPP Posted October 28, 2014 Share Posted October 28, 2014 Changelog: -Added Utilities method textToBoolean(String) -Added Utilities method booleanToText(Boolean) Umm.... booleanToText(Boolean) == (Boolean.toString(Boolean) || (Boolean+"")) textToBoolean(String) == Boolean.parseBoolean("true"); 1 Link to comment
Alek Posted October 28, 2014 Author Share Posted October 28, 2014 Umm.... booleanToText(Boolean) == (Boolean.toString(Boolean) || (Boolean+"")) textToBoolean(String) == Boolean.parseBoolean("true"); parseBoolean uses equalsIgnoreCase and I wanted to make matching methods. If it's really that big of a deal I can remove it. Just figured I would make a small private method public. From the API: It's pretty much identical.. Link to comment
NotoriousPP Posted October 28, 2014 Share Posted October 28, 2014 parseBoolean uses equalsIgnoreCase and I wanted to make matching methods. If it's really that big of a deal I can remove it. Just figured I would make a small private method public. You need to look at the default method first. Your method is completely redundant. Link to comment
Alek Posted October 28, 2014 Author Share Posted October 28, 2014 Read my post above yours, I edited it. I know what the default method looks like, that's why I made mine. If it's really that big of a problem I'll just make it private again. Link to comment
NotoriousPP Posted October 28, 2014 Share Posted October 28, 2014 Read my post above yours, I edited it. I know what the default method looks like, that's why I made mine. If it's really that big of a problem I'll just make it private again. I'm not saying that it is a problem, just useless at best. There is no reason for it to public or even be private for that matter, when you can achieve the same by using the default methods, with the added benefit of less lines of code. Not trying to put you down, just being a critic. Link to comment
Alek Posted October 28, 2014 Author Share Posted October 28, 2014 I'm not saying that it is a problem, just useless at best. There is no reason for it to public or even be private for that matter, when you can achieve the same by using the default methods, with the added benefit of less lines of code. Not trying to put you down, just being a critic. booleanToText is identical, but it was only to match textToBoolean. I wanted to assess that the string was in fact "true" without manipulation. Therefore putting it to lowercase first or toString() wasn't viable. The only reason why I mentioned it is because all API additions/changes go into the changelog. For the average person yes, it's really not needed. Edit: I'll update API documentation to make it a little bit less confusing and remove booleanToText on the next update. Link to comment
Harry Posted October 28, 2014 Share Posted October 28, 2014 Very nice. Good work Alek. Link to comment
cashmoneytyrone Posted October 29, 2014 Share Posted October 29, 2014 Awesome man, 3 minutes is completely fair. Thanks for the update! 1 Link to comment
Harry Posted October 29, 2014 Share Posted October 29, 2014 Question is: worth updating? Link to comment
Kittens Posted October 30, 2014 Share Posted October 30, 2014 Alek for president pl0x 1 Link to comment