package io.trygvis.container.compiler.model; import java.util.List; import java.util.Set; import java.util.TreeSet; import static java.util.Collections.addAll; public class MethodRef { public final TypeRef returnType; public final String name; public final ParameterRef[] parameters; public final Set exceptions = new TreeSet<>(); public final List body; public MethodRef(TypeRef returnType, String name, ParameterRef[] parameters, List body) { this.returnType = returnType; this.name = name; this.parameters = parameters; this.body = body; } public MethodRef exception(TypeRef... exceptions) { addAll(this.exceptions, exceptions); return this; } }