// Code generated by gobind. DO NOT EDIT.

// Java class io.nekohasekai.libbox.ExchangeContext is a proxy for talking to a Go program.
//
//   autogenerated by gobind -lang=java -javapkg=io.nekohasekai github.com/sagernet/sing-box/experimental/libbox
package io.nekohasekai.libbox;

import go.Seq;

public final class ExchangeContext implements Seq.Proxy {
	static { Libbox.touch(); }
	
	public final int refnum;
	
	@Override public final int incRefnum() {
	      Seq.incGoRef(refnum, this);
	      return refnum;
	}
	
	ExchangeContext(int refnum) { this.refnum = refnum; Seq.trackGoRef(refnum, this); }
	
	public ExchangeContext() { this.refnum = __New(); Seq.trackGoRef(refnum, this); }
	
	private static native int __New();
	
	public native void errnoCode(int code);
	public native void errorCode(int code);
	public native void onCancel(Func callback);
	public native void rawSuccess(byte[] result);
	public native void success(String result);
	@Override public boolean equals(Object o) {
		if (o == null || !(o instanceof ExchangeContext)) {
		    return false;
		}
		ExchangeContext that = (ExchangeContext)o;
		return true;
	}
	
	@Override public int hashCode() {
	    return java.util.Arrays.hashCode(new Object[] {});
	}
	
	@Override public String toString() {
		StringBuilder b = new StringBuilder();
		b.append("ExchangeContext").append("{");
		return b.append("}").toString();
	}
}

