Skip to content

Java8 Optional? #177

Closed
Closed

Description

@georgeyanev

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?

Activity

  1. johnjaylward commented on Nov 25, 2015

    @johnjaylward
    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions