All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.frostwire.jlibtorrent.swig.dht_pkt_alert Maven / Gradle / Ivy

There is a newer version: 1.2.0.18
Show newest version
/* ----------------------------------------------------------------------------
 * This file was automatically generated by SWIG (http://www.swig.org).
 * Version 3.0.8
 *
 * 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 dht_pkt_alert extends alert {
  private transient long swigCPtr;

  protected dht_pkt_alert(long cPtr, boolean cMemoryOwn) {
    super(libtorrent_jni.dht_pkt_alert_SWIGUpcast(cPtr), cMemoryOwn);
    swigCPtr = cPtr;
  }

  protected static long getCPtr(dht_pkt_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_dht_pkt_alert(swigCPtr);
      }
      swigCPtr = 0;
    }
    super.delete();
  }

  public int type() {
    return libtorrent_jni.dht_pkt_alert_type(swigCPtr, this);
  }

  public int category() {
    return libtorrent_jni.dht_pkt_alert_category(swigCPtr, this);
  }

  public String what() {
    return libtorrent_jni.dht_pkt_alert_what(swigCPtr, this);
  }

  public String message() {
    return libtorrent_jni.dht_pkt_alert_message(swigCPtr, this);
  }

  public int pkt_size() {
    return libtorrent_jni.dht_pkt_alert_pkt_size(swigCPtr, this);
  }

  public void setDir(dht_pkt_alert.direction_t value) {
    libtorrent_jni.dht_pkt_alert_dir_set(swigCPtr, this, value.swigValue());
  }

  public dht_pkt_alert.direction_t getDir() {
    return dht_pkt_alert.direction_t.swigToEnum(libtorrent_jni.dht_pkt_alert_dir_get(swigCPtr, this));
  }

  public void setNode(udp_endpoint value) {
    libtorrent_jni.dht_pkt_alert_node_set(swigCPtr, this, udp_endpoint.getCPtr(value), value);
  }

  public udp_endpoint getNode() {
    long cPtr = libtorrent_jni.dht_pkt_alert_node_get(swigCPtr, this);
    return (cPtr == 0) ? null : new udp_endpoint(cPtr, false);
  }

  public byte_vector get_pkt_buf() {
    return new byte_vector(libtorrent_jni.dht_pkt_alert_get_pkt_buf(swigCPtr, this), true);
  }

  public final static class direction_t {
    public final static dht_pkt_alert.direction_t incoming = new dht_pkt_alert.direction_t("incoming");
    public final static dht_pkt_alert.direction_t outgoing = new dht_pkt_alert.direction_t("outgoing");

    public final int swigValue() {
      return swigValue;
    }

    public String toString() {
      return swigName;
    }

    public static direction_t swigToEnum(int swigValue) {
      if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue)
        return swigValues[swigValue];
      for (int i = 0; i < swigValues.length; i++)
        if (swigValues[i].swigValue == swigValue)
          return swigValues[i];
      throw new IllegalArgumentException("No enum " + direction_t.class + " with value " + swigValue);
    }

    private direction_t(String swigName) {
      this.swigName = swigName;
      this.swigValue = swigNext++;
    }

    private direction_t(String swigName, int swigValue) {
      this.swigName = swigName;
      this.swigValue = swigValue;
      swigNext = swigValue+1;
    }

    private direction_t(String swigName, direction_t swigEnum) {
      this.swigName = swigName;
      this.swigValue = swigEnum.swigValue;
      swigNext = this.swigValue+1;
    }

    private static direction_t[] swigValues = { incoming, outgoing };
    private static int swigNext = 0;
    private final int swigValue;
    private final String swigName;
  }

  public final static int static_category = libtorrent_jni.dht_pkt_alert_static_category_get();
  public final static int priority = libtorrent_jni.dht_pkt_alert_priority_get();
  public final static int alert_type = libtorrent_jni.dht_pkt_alert_alert_type_get();
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy