/* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). * Version 3.0.2 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ package com.frostwire.jlibtorrent.swig; public class peer_blocked_alert extends torrent_alert { private long swigCPtr; protected peer_blocked_alert(long cPtr, boolean cMemoryOwn) { super(libtorrent_jni.peer_blocked_alert_SWIGUpcast(cPtr), cMemoryOwn); swigCPtr = cPtr; } protected static long getCPtr(peer_blocked_alert obj) { return (obj == null) ? 0 : obj.swigCPtr; } protected void finalize() { delete(); } public synchronized void delete() { if (swigCPtr != 0) { if (swigCMemOwn) { swigCMemOwn = false; libtorrent_jni.delete_peer_blocked_alert(swigCPtr); } swigCPtr = 0; } super.delete(); } public peer_blocked_alert(torrent_handle h, address i, int r) { this(libtorrent_jni.new_peer_blocked_alert(torrent_handle.getCPtr(h), h, address.getCPtr(i), i, r), true); } public int type() { return libtorrent_jni.peer_blocked_alert_type(swigCPtr, this); } public int category() { return libtorrent_jni.peer_blocked_alert_category(swigCPtr, this); } public String what() { return libtorrent_jni.peer_blocked_alert_what(swigCPtr, this); } public String message() { return libtorrent_jni.peer_blocked_alert_message(swigCPtr, this); } public void setIp(address value) { libtorrent_jni.peer_blocked_alert_ip_set(swigCPtr, this, address.getCPtr(value), value); } public address getIp() { long cPtr = libtorrent_jni.peer_blocked_alert_ip_get(swigCPtr, this); return (cPtr == 0) ? null : new address(cPtr, false); } public void setReason(int value) { libtorrent_jni.peer_blocked_alert_reason_set(swigCPtr, this, value); } public int getReason() { return libtorrent_jni.peer_blocked_alert_reason_get(swigCPtr, this); } public final static int alert_type = libtorrent_jni.peer_blocked_alert_alert_type_get(); public final static int static_category = libtorrent_jni.peer_blocked_alert_static_category_get(); public enum reason_t { ip_filter, port_filter, i2p_mixed, privileged_ports, utp_disabled, tcp_disabled; public final int swigValue() { return swigValue; } public static reason_t swigToEnum(int swigValue) { reason_t[] swigValues = reason_t.class.getEnumConstants(); if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue) return swigValues[swigValue]; for (reason_t swigEnum : swigValues) if (swigEnum.swigValue == swigValue) return swigEnum; throw new IllegalArgumentException("No enum " + reason_t.class + " with value " + swigValue); } @SuppressWarnings("unused") private reason_t() { this.swigValue = SwigNext.next++; } @SuppressWarnings("unused") private reason_t(int swigValue) { this.swigValue = swigValue; SwigNext.next = swigValue+1; } @SuppressWarnings("unused") private reason_t(reason_t swigEnum) { this.swigValue = swigEnum.swigValue; SwigNext.next = this.swigValue+1; } private final int swigValue; private static class SwigNext { private static int next = 0; } } }