import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import javax.annotation.Nullable;
/**
*/
public InitFeatures get_features() {
long ret = bindings.Init_get_features(this.ptr);
- InitFeatures ret_hu_conv = new InitFeatures(null, ret);
+ if (ret >= 0 && ret <= 4096) { return null; }
+ InitFeatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new InitFeatures(null, ret); }
ret_hu_conv.ptrs_to.add(this);
return ret_hu_conv;
}
*/
public void set_features(InitFeatures val) {
bindings.Init_set_features(this.ptr, val == null ? 0 : val.ptr & ~1);
- this.ptrs_to.add(val);
}
/**
* Constructs a new Init given each field
*/
- public static Init constructor_new(InitFeatures features_arg) {
+ public static Init of(InitFeatures features_arg) {
long ret = bindings.Init_new(features_arg == null ? 0 : features_arg.ptr & ~1);
- Init ret_hu_conv = new Init(null, ret);
+ if (ret >= 0 && ret <= 4096) { return null; }
+ Init ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new Init(null, ret); }
ret_hu_conv.ptrs_to.add(ret_hu_conv);
- ret_hu_conv.ptrs_to.add(features_arg);
return ret_hu_conv;
}
*/
public Init clone() {
long ret = bindings.Init_clone(this.ptr);
- Init ret_hu_conv = new Init(null, ret);
+ if (ret >= 0 && ret <= 4096) { return null; }
+ Init ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new Init(null, ret); }
ret_hu_conv.ptrs_to.add(this);
return ret_hu_conv;
}
/**
* Read a Init from a byte array, created by Init_write
*/
- public static Result_InitDecodeErrorZ constructor_read(byte[] ser) {
+ public static Result_InitDecodeErrorZ read(byte[] ser) {
long ret = bindings.Init_read(ser);
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_InitDecodeErrorZ ret_hu_conv = Result_InitDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}