Class ArgumentSpec<Out_>

java.lang.Object
ai.timefold.jpyinterpreter.util.arguments.ArgumentSpec<Out_>

public final class ArgumentSpec<Out_> extends Object
  • Method Details

    • forFunctionReturning

      public static <T extends PythonLikeObject> ArgumentSpec<T> forFunctionReturning(String functionName, String outClass)
    • getTotalArgumentCount

      public int getTotalArgumentCount()
    • getAllowPositionalArgumentCount

      public int getAllowPositionalArgumentCount()
    • hasExtraPositionalArgumentsCapture

      public boolean hasExtraPositionalArgumentsCapture()
    • hasExtraKeywordArgumentsCapture

      public boolean hasExtraKeywordArgumentsCapture()
    • getArgumentTypeInternalName

      public String getArgumentTypeInternalName(int argumentIndex)
    • getArgumentKind

      public ArgumentKind getArgumentKind(int argumentIndex)
    • getArgumentIndex

      public int getArgumentIndex(String argumentName)
      Returns the index of an argument with the given name. Returns -1 if no argument has the given name.
      Parameters:
      argumentName - The name of the argument.
      Returns:
      the index of an argument with the given name, or -1 if no argument has that name
    • isArgumentNullable

      public boolean isArgumentNullable(int argumentIndex)
    • getExtraPositionalsArgumentIndex

      public Optional<Integer> getExtraPositionalsArgumentIndex()
    • getExtraKeywordsArgumentIndex

      public Optional<Integer> getExtraKeywordsArgumentIndex()
    • getUnspecifiedArgumentSet

      public Collection<Integer> getUnspecifiedArgumentSet(int positionalArguments, List<String> keywordArgumentNameList)
    • getArgumentSpec

      public static ArgumentSpec<?> getArgumentSpec(int argumentSpecIndex)
    • loadArgumentSpec

      public void loadArgumentSpec(org.objectweb.asm.MethodVisitor methodVisitor)
    • extractArgumentList

      public List<PythonLikeObject> extractArgumentList(List<PythonLikeObject> positionalArguments, Map<PythonString,PythonLikeObject> keywordArguments)
    • verifyMatchesCallSignature

      public boolean verifyMatchesCallSignature(int positionalArgumentCount, List<String> keywordArgumentNameList, List<PythonLikeType> callStackTypeList)
    • addArgument

      public <ArgumentType_ extends PythonLikeObject> ArgumentSpec<Out_> addArgument(String argumentName, String argumentTypeName)
    • addPositionalOnlyArgument

      public <ArgumentType_ extends PythonLikeObject> ArgumentSpec<Out_> addPositionalOnlyArgument(String argumentName, String argumentTypeName)
    • addKeywordOnlyArgument

      public <ArgumentType_ extends PythonLikeObject> ArgumentSpec<Out_> addKeywordOnlyArgument(String argumentName, String argumentTypeName)
    • addArgument

      public <ArgumentType_ extends PythonLikeObject> ArgumentSpec<Out_> addArgument(String argumentName, String argumentTypeName, ArgumentType_ defaultValue)
    • addPositionalOnlyArgument

      public <ArgumentType_ extends PythonLikeObject> ArgumentSpec<Out_> addPositionalOnlyArgument(String argumentName, String argumentTypeName, ArgumentType_ defaultValue)
    • addKeywordOnlyArgument

      public <ArgumentType_ extends PythonLikeObject> ArgumentSpec<Out_> addKeywordOnlyArgument(String argumentName, String argumentTypeName, ArgumentType_ defaultValue)
    • addNullableArgument

      public <ArgumentType_ extends PythonLikeObject> ArgumentSpec<Out_> addNullableArgument(String argumentName, String argumentTypeName)
    • addNullablePositionalOnlyArgument

      public <ArgumentType_ extends PythonLikeObject> ArgumentSpec<Out_> addNullablePositionalOnlyArgument(String argumentName, String argumentTypeName)
    • addNullableKeywordOnlyArgument

      public <ArgumentType_ extends PythonLikeObject> ArgumentSpec<Out_> addNullableKeywordOnlyArgument(String argumentName, String argumentTypeName)
    • addExtraPositionalVarArgument

      public ArgumentSpec<Out_> addExtraPositionalVarArgument(String argumentName)
    • addExtraKeywordVarArgument

      public ArgumentSpec<Out_> addExtraKeywordVarArgument(String argumentName)
    • asPythonFunctionSignature

      public PythonFunctionSignature asPythonFunctionSignature(Method method)
    • asStaticPythonFunctionSignature

      public PythonFunctionSignature asStaticPythonFunctionSignature(Method method)
    • asClassPythonFunctionSignature

      public PythonFunctionSignature asClassPythonFunctionSignature(Method method)
    • asPythonFunctionSignature

      public PythonFunctionSignature asPythonFunctionSignature(String internalClassName, String methodName, String methodDescriptor)
    • asStaticPythonFunctionSignature

      public PythonFunctionSignature asStaticPythonFunctionSignature(String internalClassName, String methodName, String methodDescriptor)
    • asClassPythonFunctionSignature

      public PythonFunctionSignature asClassPythonFunctionSignature(String internalClassName, String methodName, String methodDescriptor)
    • getDefaultValue

      public Object getDefaultValue(int defaultIndex)
    • toString

      public String toString()
      Overrides:
      toString in class Object