Uploaded image for project: 'Tapestry 5'
  1. Tapestry 5
  2. TAP5-2728

EventContext enhancements

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 5.8.1
    • 5.8.2
    • tapestry-core
    • None

    Description

      The EventContext is an essential tool for accessing event related data, but its functionality is quite limited.
      The most common use case – accessing its data – must be done in a try-catch-block.
      If multiple values are involved, the resulting code isn't that pretty.

      Adding Optional<T> tryGet(Class<T> desiredType, int index) would allow to access the values in a more lenient way and provide a bridge between a possible null value and the fluent/functional Optional API.

      Also, a boolean isEmpty() would cover another common use case with less and more speaking code.

      Attachments

        Activity

          People

            Unassigned Unassigned
            ben-ng Ben Weidig
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0h
                0h
                Logged:
                Time Spent - 20m
                20m