Uploaded image for project: 'Commons Lang'
  1. Commons Lang
  2. LANG-545

Add ability to create a Future for a constant

    Details

    • Type: New Feature
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.0
    • Component/s: lang.concurrent.*
    • Labels:
      None

      Description

      The concurrent Future interface is a nice way to gain access to an object at some future point in time. However, sometimes you need an implementation that isn't used for concurrency, but is used to avoid a null check or for testing.

      Add a ConstantFuture class that implements the Future interface and returns the constant value.

        Attachments

        1. ConstantFuture.patch
          4 kB
          Stephen Colebourne

          Issue Links

            Activity

              People

              • Assignee:
                scolebourne Stephen Colebourne
                Reporter:
                scolebourne Stephen Colebourne
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: