public sealed interface FunctionDescriptor
FunctionDescriptor
is a preview API of the Java platform. Modifier and Type | Method | Description |
---|---|---|
FunctionDescriptorPREVIEW |
appendArgumentLayouts |
Returns a function descriptor with the given argument layouts appended to the argument layouts of this function descriptor. |
List |
argumentLayouts() |
Returns the argument layouts of this function descriptor (as an unmodifiable list). |
FunctionDescriptorPREVIEW |
changeReturnLayout |
Returns a function descriptor with the provided return layout. |
FunctionDescriptorPREVIEW |
dropReturnLayout() |
Returns a new function descriptor, with no return layout. |
FunctionDescriptorPREVIEW |
insertArgumentLayouts |
Returns a function descriptor with the given argument layouts inserted at the given index, into the argument layout array of this function descriptor. |
static FunctionDescriptorPREVIEW |
of |
Creates a function descriptor with the given return and argument layouts. |
static FunctionDescriptorPREVIEW |
ofVoid |
Creates a function descriptor with the given argument layouts and no return layout. |
Optional |
returnLayout() |
Returns the return layout (if any) of this function descriptor. |
MethodType |
toMethodType() |
Returns the method type consisting of the carrier types of the layouts in this function descriptor. |
Optional<MemoryLayoutPREVIEW> returnLayout()
List<MemoryLayoutPREVIEW> argumentLayouts()
FunctionDescriptorPREVIEW appendArgumentLayouts(MemoryLayoutPREVIEW... addedLayouts)
addedLayouts
- the argument layouts to append.IllegalArgumentException
- if one of the layouts in addedLayouts
is a padding layout.FunctionDescriptorPREVIEW insertArgumentLayouts(int index, MemoryLayoutPREVIEW... addedLayouts)
index
- the index at which to insert the argumentsaddedLayouts
- the argument layouts to insert at given index.IllegalArgumentException
- if one of the layouts in addedLayouts
is a padding layout.IllegalArgumentException
- if index < 0 || index > argumentLayouts().size()
.FunctionDescriptorPREVIEW changeReturnLayout(MemoryLayoutPREVIEW newReturn)
newReturn
- the new return layout.IllegalArgumentException
- if newReturn
is a padding layout.FunctionDescriptorPREVIEW dropReturnLayout()
MethodType toMethodType()
The carrier type of a layout L
is determined as follows:
L
is a ValueLayout
PREVIEW the carrier type is determined through ValueLayout.carrier()
PREVIEW.L
is a GroupLayout
PREVIEW or a SequenceLayout
PREVIEW, the carrier type is MemorySegment
PREVIEW.static FunctionDescriptorPREVIEW of(MemoryLayoutPREVIEW resLayout, MemoryLayoutPREVIEW... argLayouts)
resLayout
- the return layout.argLayouts
- the argument layouts.IllegalArgumentException
- if resLayout
is a padding layout.IllegalArgumentException
- if one of the layouts in argLayouts
is a padding layout.static FunctionDescriptorPREVIEW ofVoid(MemoryLayoutPREVIEW... argLayouts)
argLayouts
- the argument layouts.IllegalArgumentException
- if one of the layouts in argLayouts
is a padding layout.
© 1993, 2023, Oracle and/or its affiliates. All rights reserved.
Documentation extracted from Debian's OpenJDK Development Kit package.
Licensed under the GNU General Public License, version 2, with the Classpath Exception.
Various third party code in OpenJDK is licensed under different licenses (see Debian package).
Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/foreign/FunctionDescriptor.html
FunctionDescriptor
when preview features are enabled.