Uploaded image for project: 'Sling'
  1. Sling
  2. SLING-3714

Allow for a caller to request a non-null response from adaptTo()

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Won't Fix
    • None
    • None
    • None
    • None

    Description

      See SLING-3709 for a Sling Models-specific request. As I commented there, I think this makes more sense as a core change to the Adaptable interface.

      One option:

      resource.adaptTo(Result<Node>.class)

      Which returns a Result object, which has an API like:

      interface Result<T> {
      boolean isSuccess();
      T getObject();
      List<Error> getErrors();
      }

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              justinedelson Justin Edelson
              Votes:
              1 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: