All Downloads are FREE. Search and download functionalities are using the official Maven repository.

cn.nukkit.plugin.js.compiler.JMethod Maven / Gradle / Ivy

There is a newer version: 1.20.40-r1
Show newest version
package cn.nukkit.plugin.js.compiler;

import org.jetbrains.annotations.NotNull;
import org.objectweb.asm.Type;

import java.util.Arrays;

public record JMethod(JClassBuilder builder, String methodName, String delegateName, JType returnType, JType... argTypes) {
    public JMethod(JClassBuilder builder, String name, JType returnType, JType... argTypes) {
        this(builder, name, name, returnType, argTypes);
    }

    @NotNull
    public Type[] argAsmTypes() {
        return Arrays.stream(this.argTypes()).map(JType::asmType).toArray(Type[]::new);
    }

    @NotNull
    public Type returnAsmType() {
        return returnType.asmType();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy