# Preview API

Show preview API for:

- 432: Record Patterns (Second Preview)
- 433: Pattern Matching for switch (Fourth Preview)
- 434: Foreign Function & Memory API (Second Preview)
- 436: Virtual Threads (Second Preview)

## Contents

- Interfaces
- Classes
- Enum Classes
- Exception Classes
- Methods
- Enum Constants

- Interfaces
  Interface
  Preview Feature
  Description
  com.sun.source.tree.CaseLabelTreePREVIEW
  Pattern Matching for switch
  A marker interface for `Tree`s that may be used as `CaseTree` labels.
  com.sun.source.tree.ConstantCaseLabelTreePREVIEW
  Pattern Matching for switch
  A case label element that refers to a constant expression
  com.sun.source.tree.DeconstructionPatternTreePREVIEW
  Record Patterns
  A deconstruction pattern tree.
  com.sun.source.tree.DefaultCaseLabelTreePREVIEW
  Pattern Matching for switch
  A case label that marks `default` in `case null, default`.
  com.sun.source.tree.ParenthesizedPatternTreePREVIEW
  Pattern Matching for switch
  A tree node for a parenthesized pattern.
  com.sun.source.tree.PatternCaseLabelTreePREVIEW
  Pattern Matching for switch
  A case label element that refers to an expression
  java.lang.foreign.ArenaPREVIEW
  Foreign Function & Memory API
  An arena controls the lifecycle of memory segments, providing both flexible allocation and timely deallocation.
  java.lang.foreign.FunctionDescriptorPREVIEW
  Foreign Function & Memory API
  A function descriptor models the signature of foreign functions.
  java.lang.foreign.GroupLayoutPREVIEW
  Foreign Function & Memory API
  A compound layout that aggregates multiple member layouts.
  java.lang.foreign.LinkerPREVIEW
  Foreign Function & Memory API
  A linker provides access to foreign functions from Java code, and access to Java code from foreign functions.
  java.lang.foreign.Linker.OptionPREVIEW
  Foreign Function & Memory API
  A linker option is used to indicate additional linking requirements to the linker, besides what is described by a function descriptor.
  java.lang.foreign.Linker.Option.CaptureCallStatePREVIEW
  Foreign Function & Memory API
  A linker option for saving portions of the execution state immediately after calling a foreign function associated with a downcall method handle, before it can be overwritten by the runtime, or read through conventional means.
  java.lang.foreign.MemoryLayoutPREVIEW
  Foreign Function & Memory API
  A memory layout describes the contents of a memory segment.
  java.lang.foreign.MemoryLayout.PathElementPREVIEW
  Foreign Function & Memory API
  An element in a layout path.
  java.lang.foreign.MemorySegmentPREVIEW
  Foreign Function & Memory API
  A memory segment provides access to a contiguous region of memory.
  java.lang.foreign.PaddingLayoutPREVIEW
  Foreign Function & Memory API
  A padding layout.
  java.lang.foreign.SegmentAllocatorPREVIEW
  Foreign Function & Memory API
  An object that may be used to allocate memory segmentsPREVIEW.
  java.lang.foreign.SegmentScopePREVIEW
  Foreign Function & Memory API
  A segment scope controls access to memory segments.
  java.lang.foreign.SequenceLayoutPREVIEW
  Foreign Function & Memory API
  A compound layout that denotes a repetition of a given element layout.
  java.lang.foreign.StructLayoutPREVIEW
  Foreign Function & Memory API
  A group layout whose member layouts are laid out one after the other.
  java.lang.foreign.SymbolLookupPREVIEW
  Foreign Function & Memory API
  A symbol lookup retrieves the address of a symbol in one or more libraries.
  java.lang.foreign.UnionLayoutPREVIEW
  Foreign Function & Memory API
  A group layout whose member layouts are laid out at the same starting offset.
  java.lang.foreign.VaListPREVIEW
  Foreign Function & Memory API
  Helper class to create and manipulate variable argument lists, similar in functionality to a C `va_list`.
  java.lang.foreign.VaList.BuilderPREVIEW
  Foreign Function & Memory API
  A builder used to construct a variable argument listPREVIEW.
  java.lang.foreign.ValueLayoutPREVIEW
  Foreign Function & Memory API
  A layout that models values of basic data types.
  java.lang.foreign.ValueLayout.OfAddressPREVIEW
  Foreign Function & Memory API
  A value layout whose carrier is `MemorySegment.class`.
  java.lang.foreign.ValueLayout.OfBooleanPREVIEW
  Foreign Function & Memory API
  A value layout whose carrier is `boolean.class`.
  java.lang.foreign.ValueLayout.OfBytePREVIEW
  Foreign Function & Memory API
  A value layout whose carrier is `byte.class`.
  java.lang.foreign.ValueLayout.OfCharPREVIEW
  Foreign Function & Memory API
  A value layout whose carrier is `char.class`.
  java.lang.foreign.ValueLayout.OfDoublePREVIEW
  Foreign Function & Memory API
  A value layout whose carrier is `double.class`.
  java.lang.foreign.ValueLayout.OfFloatPREVIEW
  Foreign Function & Memory API
  A value layout whose carrier is `float.class`.
  java.lang.foreign.ValueLayout.OfIntPREVIEW
  Foreign Function & Memory API
  A value layout whose carrier is `int.class`.
  java.lang.foreign.ValueLayout.OfLongPREVIEW
  Foreign Function & Memory API
  A value layout whose carrier is `long.class`.
  java.lang.foreign.ValueLayout.OfShortPREVIEW
  Foreign Function & Memory API
  A value layout whose carrier is `short.class`.
  java.lang.Thread.BuilderPREVIEW
  Virtual Threads
  A builder for `Thread` and `ThreadFactory` objects.
  java.lang.Thread.Builder.OfPlatformPREVIEW
  Virtual Threads
  A builder for creating a platform `Thread` or `ThreadFactory` that creates platform threads.
  java.lang.Thread.Builder.OfVirtualPREVIEW
  Virtual Threads
  A builder for creating a virtual `Thread` or `ThreadFactory` that creates virtual threads.

- Classes
  Class
  Preview Feature
  Description
  java.lang.runtime.SwitchBootstrapsPREVIEW
  Pattern Matching for switch
  Bootstrap methods for linking `invokedynamic` call sites that implement the selection functionality of the `switch` statement.

- Enum Classes
  Enum Class
  Preview Feature
  Description
  com.sun.management.HotSpotDiagnosticMXBean.ThreadDumpFormatPREVIEW
  Virtual Threads
  Thread dump format.
  com.sun.source.tree.EnhancedForLoopTree.DeclarationKindPREVIEW
  Record Patterns
  "Enhanced" `for` declarations come in two forms: local variable declarations and record patterns
  com.sun.source.tree.InstanceOfTree.TestKindPREVIEW
  Record Patterns
  Two possible variants of instanceof expressions: testing types, and performing pattern matching

- Exception Classes
  Exception Class
  Preview Feature
  Description
  java.lang.MatchExceptionPREVIEW
  Pattern Matching for switch
  Thrown to indicate an unexpected failure in pattern matching.

- Methods
  Method
  Preview Feature
  Description
  com.sun.jdi.request.ThreadDeathRequest.addPlatformThreadsOnlyFilter()PREVIEW
  Virtual Threads
  Restricts the events generated by this request to only platform threads.
  com.sun.jdi.request.ThreadStartRequest.addPlatformThreadsOnlyFilter()PREVIEW
  Virtual Threads
  Restricts the events generated by this request to only platform threads.
  com.sun.jdi.ThreadReference.isVirtual()PREVIEW
  Virtual Threads
  Returns `true` if the thread is a virtual thread.
  com.sun.management.HotSpotDiagnosticMXBean.dumpThreads(String, HotSpotDiagnosticMXBean.ThreadDumpFormat)PREVIEW
  Virtual Threads
  Generate a thread dump to the given file in the given format.
  com.sun.source.tree.CaseTree.getLabels()PREVIEW
  Pattern Matching for switch
  Returns the labels for this case.
  com.sun.source.tree.EnhancedForLoopTree.getDeclarationKind()PREVIEW
  Record Patterns
  Returns the kind of the declaration of the "enhanced" `for`.
  com.sun.source.tree.EnhancedForLoopTree.getVariableOrRecordPattern()PREVIEW
  Record Patterns
  Returns the control variable or pattern for the loop.
  com.sun.source.tree.InstanceOfTree.getTestKind()PREVIEW
  Record Patterns
  Returns the kind of this instanceof expression.
  com.sun.source.tree.TreeVisitor.visitConstantCaseLabel(ConstantCaseLabelTree, P)PREVIEW
  Pattern Matching for switch
  Visits a `ConstantCaseLabelTree` node.
  com.sun.source.tree.TreeVisitor.visitDeconstructionPattern(DeconstructionPatternTree, P)PREVIEW
  Record Patterns
  Visits a `DeconstructionPatternTree` node.
  com.sun.source.tree.TreeVisitor.visitDefaultCaseLabel(DefaultCaseLabelTree, P)PREVIEW
  Pattern Matching for switch
  Visits a `DefaultCaseLabelTree` node.
  com.sun.source.tree.TreeVisitor.visitParenthesizedPattern(ParenthesizedPatternTree, P)PREVIEW
  Pattern Matching for switch
  Visits a `ParenthesizedPatternTree` node.
  com.sun.source.tree.TreeVisitor.visitPatternCaseLabel(PatternCaseLabelTree, P)PREVIEW
  Pattern Matching for switch
  Visits a `PatternCaseLabelTree` node.
  com.sun.source.util.SimpleTreeVisitor.visitConstantCaseLabel(ConstantCaseLabelTree, P)PREVIEW
  Pattern Matching for switch
  Visits a `ConstantCaseLabelTree` node.
  com.sun.source.util.SimpleTreeVisitor.visitDeconstructionPattern(DeconstructionPatternTree, P)PREVIEW
  Record Patterns
  Visits a `DeconstructionPatternTree` node.
  com.sun.source.util.SimpleTreeVisitor.visitDefaultCaseLabel(DefaultCaseLabelTree, P)PREVIEW
  Pattern Matching for switch
  Visits a `DefaultCaseLabelTree` node.
  com.sun.source.util.SimpleTreeVisitor.visitParenthesizedPattern(ParenthesizedPatternTree, P)PREVIEW
  Pattern Matching for switch
  Visits a `ParenthesizedPatternTree` node.
  com.sun.source.util.SimpleTreeVisitor.visitPatternCaseLabel(PatternCaseLabelTree, P)PREVIEW
  Pattern Matching for switch
  Visits a `PatternCaseLabelTree` node.
  com.sun.source.util.TreeScanner.visitConstantCaseLabel(ConstantCaseLabelTree, P)PREVIEW
  Pattern Matching for switch
  Visits a `ConstantCaseLabelTree` node.
  com.sun.source.util.TreeScanner.visitDeconstructionPattern(DeconstructionPatternTree, P)PREVIEW
  Record Patterns
  Visits a `DeconstructionPatternTree` node.
  com.sun.source.util.TreeScanner.visitDefaultCaseLabel(DefaultCaseLabelTree, P)PREVIEW
  Pattern Matching for switch
  Visits a `DefaultCaseLabelTree` node.
  com.sun.source.util.TreeScanner.visitParenthesizedPattern(ParenthesizedPatternTree, P)PREVIEW
  Pattern Matching for switch
  Visits a `ParenthesizedPatternTree` node.
  com.sun.source.util.TreeScanner.visitPatternCaseLabel(PatternCaseLabelTree, P)PREVIEW
  Pattern Matching for switch
  Visits a `PatternCaseLabelTree` node.
  java.lang.invoke.MethodHandles.collectCoordinates(VarHandle, int, MethodHandle)PREVIEW
  Foreign Function & Memory API
  Adapts a target var handle by pre-processing a sub-sequence of its coordinate values with a filter (a method handle).
  java.lang.invoke.MethodHandles.dropCoordinates(VarHandle, int, Class<?>...)PREVIEW
  Foreign Function & Memory API
  Returns a var handle which will discard some dummy coordinates before delegating to the target var handle.
  java.lang.invoke.MethodHandles.filterCoordinates(VarHandle, int, MethodHandle...)PREVIEW
  Foreign Function & Memory API
  Adapts a target var handle by pre-processing incoming coordinate values using unary filter functions.
  java.lang.invoke.MethodHandles.filterValue(VarHandle, MethodHandle, MethodHandle)PREVIEW
  Foreign Function & Memory API
  Adapts a target var handle by pre-processing incoming and outgoing values using a pair of filter functions.
  java.lang.invoke.MethodHandles.insertCoordinates(VarHandle, int, Object...)PREVIEW
  Foreign Function & Memory API
  Provides a target var handle with one or more bound coordinates in advance of the var handle's invocation.
  java.lang.invoke.MethodHandles.memorySegmentViewVarHandle(ValueLayout)PREVIEW
  Foreign Function & Memory API
  Creates a var handle object, which can be used to dereference a memory segmentPREVIEW by viewing its contents as a sequence of the provided value layout.
  java.lang.invoke.MethodHandles.permuteCoordinates(VarHandle, List<Class<?>>, int...)PREVIEW
  Foreign Function & Memory API
  Provides a var handle which adapts the coordinate values of the target var handle, by re-arranging them so that the new coordinates match the provided ones.
  java.lang.Module.isNativeAccessEnabled()PREVIEW
  Foreign Function & Memory API
  Returns `true` if this module can access restricted methods.
  java.lang.ModuleLayer.Controller.enableNativeAccess(Module)PREVIEW
  Foreign Function & Memory API
  Enables native access for a module in the layer if the caller's module has native access.
  java.lang.Thread.isVirtual()PREVIEW
  Virtual Threads
  Returns `true` if this thread is a virtual thread.
  java.lang.Thread.ofPlatform()PREVIEW
  Virtual Threads
  Returns a builder for creating a platform `Thread` or `ThreadFactory` that creates platform threads.
  java.lang.Thread.ofVirtual()PREVIEW
  Virtual Threads
  Returns a builder for creating a virtual `Thread` or `ThreadFactory` that creates virtual threads.
  java.lang.Thread.startVirtualThread(Runnable)PREVIEW
  Virtual Threads
  Creates a virtual thread to execute a task and schedules it to execute.
  java.nio.channels.FileChannel.map(FileChannel.MapMode, long, long, SegmentScope)PREVIEW
  Foreign Function & Memory API
  Maps a region of this channel's file into a new mapped memory segment, with the given offset, size and memory session.
  java.util.concurrent.Executors.newThreadPerTaskExecutor(ThreadFactory)PREVIEW
  Virtual Threads
  Creates an Executor that starts a new Thread for each task.
  java.util.concurrent.Executors.newVirtualThreadPerTaskExecutor()PREVIEW
  Virtual Threads
  Creates an Executor that starts a new virtual Thread for each task.
  jdk.jfr.consumer.RecordedThread.isVirtual()PREVIEW
  Virtual Threads
  Returns `true` if this is a virtual Thread, `false` otherwise.

- Enum Constants
  Enum Constant
  Preview Feature
  Description
  com.sun.source.tree.Tree.Kind.CONSTANT_CASE_LABELPREVIEW
  Pattern Matching for switch
  Used for instances of `ConstantCaseLabelTree`PREVIEW.
  com.sun.source.tree.Tree.Kind.DECONSTRUCTION_PATTERNPREVIEW
  Record Patterns
  Used for instances of `DeconstructionPatternTree`PREVIEW.
  com.sun.source.tree.Tree.Kind.DEFAULT_CASE_LABELPREVIEW
  Pattern Matching for switch
  Used for instances of `DefaultCaseLabelTree`PREVIEW.
  com.sun.source.tree.Tree.Kind.PARENTHESIZED_PATTERNPREVIEW
  Pattern Matching for switch
  Used for instances of `ParenthesizedPatternTree`PREVIEW.
  com.sun.source.tree.Tree.Kind.PATTERN_CASE_LABELPREVIEW
  Pattern Matching for switch
  Used for instances of `PatternCaseLabelTree`PREVIEW.