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

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

Attach filesAttach ScreenshotAdd voteVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      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

            • Assignee:
              Unassigned
              Reporter:
              justinedelson Justin Edelson

              Dates

              • Created:
                Updated:

                Issue deployment