Skip to content

Java8 Optional? #177

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
georgeyanev opened this issue Nov 25, 2015 · 1 comment
Closed

Java8 Optional? #177

georgeyanev opened this issue Nov 25, 2015 · 1 comment

Comments

@georgeyanev
Copy link

Hi,
Is there any plans to support the Optional type from java8 for return values of this opt methods you have?
So that I could for example do this

Optional<String> streetName = obj.optJSONObject("person")
     .flatMap(person -> person.optJSONObject("address"))
     .flatMap(adr -> adr.optString("streetName"));

Instead of checking for null values after every opt method?

@johnjaylward
Copy link
Contributor

not at this time. we are currently supporting java 7 for android support

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants