package net.wizardsoflua.lua.module;

import static java.util.Objects.requireNonNull;

import net.wizardsoflua.lua.Converters;
import net.wizardsoflua.lua.Transferable;
import net.wizardsoflua.lua.classes.LuaClassLoader;

public class LuaModuleApi<D> implements Transferable {
  protected final LuaClassLoader classLoader;
  protected D delegate;

  public LuaModuleApi(LuaClassLoader classLoader, D delegate) {
    this.classLoader = requireNonNull(classLoader, "classLoader == null!");
    this.delegate = requireNonNull(delegate, "delegate == null!");
  }

  public LuaClassLoader getClassLoader() {
    return classLoader;
  }

  public D getDelegate() {
    return delegate;
  }

  /**
   * @param delegate the new value for {@link #delegate}
   */
  public void setDelegate(D delegate) {
    this.delegate = requireNonNull(delegate, "delegate == null!");
  }

  public Converters getConverters() {
    return classLoader.getConverters();
  }

  @Override
  public boolean isTransferable() {
    return false;
  }
}

@@ -213,16 +213,70 @@
 sLoader;
+%0Aimport net.wizardsoflua.lua.classes.common.Delegator;
 %0A%0Apublic
@@ -321,16 +321,30 @@
 sferable
+, Delegator%3CD%3E
  %7B%0A  pro
@@ -689,24 +689,36 @@
 oader;%0A  %7D%0A%0A
+  @Override%0A
   public D g

Fix #182