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

cn.nukkit.plugin.js.compiler.JConstructor 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 JConstructor(JClassBuilder builder, String superDelegateName, String constructorDelegateName,
                           JType[] superTypes, JType... argTypes) {

    public JConstructor(JClassBuilder builder, JType[] superTypes, JType... argTypes) {
        this(builder, "new", "constructor", superTypes, argTypes);
    }

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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy