// Code generated by gobind. DO NOT EDIT.

// Java class io.nekohasekai.libbox.NetworkInterface 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 NetworkInterface implements Seq.Proxy {
	static { Libbox.touch(); }
	
	public final int refnum;
	
	@Override public final int incRefnum() {
	      Seq.incGoRef(refnum, this);
	      return refnum;
	}
	
	NetworkInterface(int refnum) { this.refnum = refnum; Seq.trackGoRef(refnum, this); }
	
	public NetworkInterface() { this.refnum = __New(); Seq.trackGoRef(refnum, this); }
	
	private static native int __New();
	
	public final native int getIndex();
	public final native void setIndex(int v);
	
	public final native int getMTU();
	public final native void setMTU(int v);
	
	public final native String getName();
	public final native void setName(String v);
	
	public final native StringIterator getAddresses();
	public final native void setAddresses(StringIterator v);
	
	@Override public boolean equals(Object o) {
		if (o == null || !(o instanceof NetworkInterface)) {
		    return false;
		}
		NetworkInterface that = (NetworkInterface)o;
		int thisIndex = getIndex();
		int thatIndex = that.getIndex();
		if (thisIndex != thatIndex) {
		    return false;
		}
		int thisMTU = getMTU();
		int thatMTU = that.getMTU();
		if (thisMTU != thatMTU) {
		    return false;
		}
		String thisName = getName();
		String thatName = that.getName();
		if (thisName == null) {
			if (thatName != null) {
			    return false;
			}
		} else if (!thisName.equals(thatName)) {
		    return false;
		}
		StringIterator thisAddresses = getAddresses();
		StringIterator thatAddresses = that.getAddresses();
		if (thisAddresses == null) {
			if (thatAddresses != null) {
			    return false;
			}
		} else if (!thisAddresses.equals(thatAddresses)) {
		    return false;
		}
		return true;
	}
	
	@Override public int hashCode() {
	    return java.util.Arrays.hashCode(new Object[] {getIndex(), getMTU(), getName(), getAddresses()});
	}
	
	@Override public String toString() {
		StringBuilder b = new StringBuilder();
		b.append("NetworkInterface").append("{");
		b.append("Index:").append(getIndex()).append(",");
		b.append("MTU:").append(getMTU()).append(",");
		b.append("Name:").append(getName()).append(",");
		b.append("Addresses:").append(getAddresses()).append(",");
		return b.append("}").toString();
	}
}

