- java_trait_constr = "\tprivate static class " + struct_name + "Holder { " + struct_name.replace("LDK", "") + " held; }\n"
- java_trait_constr = java_trait_constr + "\tpublic static " + struct_name.replace("LDK", "") + " new_impl(" + struct_name.replace("LDK", "") + "Interface arg"
- for var in field_var_conversions:
- if isinstance(var, ConvInfo):
- java_trait_constr = java_trait_constr + ", " + var.java_hu_ty + " " + var.arg_name
- else:
- # Ideally we'd be able to take any instance of the interface, but our C code can only represent
- # Java-implemented version, so we require users pass a Java implementation here :/
- java_trait_constr = java_trait_constr + ", " + var[0].replace("LDK", "") + "." + var[0].replace("LDK", "") + "Interface " + var[1] + "_impl"
- java_trait_constr = java_trait_constr + ") {\n\t\tfinal " + struct_name + "Holder impl_holder = new " + struct_name + "Holder();\n"