public sealed interface FunctionDescriptor
| Modifier and Type | Method | Description |
|---|---|---|
FunctionDescriptor |
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). |
FunctionDescriptor |
changeReturnLayout |
Returns a function descriptor with the provided return layout. |
FunctionDescriptor |
dropReturnLayout() |
Returns a new function descriptor, with no return layout. |
FunctionDescriptor |
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 FunctionDescriptor |
of |
Creates a function descriptor with the given return and argument layouts. |
static FunctionDescriptor |
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<MemoryLayout> returnLayout()
List<MemoryLayout> argumentLayouts()
FunctionDescriptor appendArgumentLayouts(MemoryLayout... addedLayouts)
addedLayouts - the argument layouts to appendIllegalArgumentException - if one of the layouts in addedLayouts is a padding layoutFunctionDescriptor insertArgumentLayouts(int index, MemoryLayout... addedLayouts)
index - the index at which to insert the argumentsaddedLayouts - the argument layouts to insert at given indexIllegalArgumentException - if one of the layouts in addedLayouts is a padding layoutIllegalArgumentException - if index < 0 || index > argumentLayouts().size()
FunctionDescriptor changeReturnLayout(MemoryLayout newReturn)
newReturn - the new return layoutIllegalArgumentException - if newReturn is a padding layoutFunctionDescriptor dropReturnLayout()
MethodType toMethodType()
The carrier type of a layout L is determined as follows:
L is a ValueLayout the carrier type is determined through ValueLayout.carrier().L is a GroupLayout or a SequenceLayout, the carrier type is MemorySegment.static FunctionDescriptor of(MemoryLayout resLayout, MemoryLayout... argLayouts)
resLayout - the return layoutargLayouts - the argument layoutsIllegalArgumentException - if resLayout is a padding layoutIllegalArgumentException - if one of the layouts in argLayouts is a padding layoutstatic FunctionDescriptor ofVoid(MemoryLayout... argLayouts)
argLayouts - the argument layoutsIllegalArgumentException - if one of the layouts in argLayouts is a padding layout
© 1993, 2025, 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/25/docs/api/java.base/java/lang/foreign/FunctionDescriptor.html