Class ScopedValuesPreviewNotes

java.lang.Object
net.jrodolfo.java_evolution.java21.ScopedValuesPreviewNotes

public class ScopedValuesPreviewNotes extends Object
Explains scoped values as a Java 21 preview feature.

Contextual data such as request IDs or security context is often passed with ThreadLocal, but thread-local state can be mutable and difficult to clean up correctly. Scoped values provide immutable context bound to a limited execution scope.

The Java 21 API was preview, so this repository keeps the feature as notes.

  • Constructor Details

    • ScopedValuesPreviewNotes

      public ScopedValuesPreviewNotes()
  • Method Details

    • purpose

      public String purpose()
      Explains the goal of scoped values.
      Returns:
      a short explanation
    • previewStatus

      public String previewStatus()
      Describes the Java 21 maturity level.
      Returns:
      a short status note