/* ----------------------------------------------------------------------------
 * This file was automatically generated by SWIG (https://www.swig.org).
 * Version 4.1.0
 *
 * 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 session_params {
  private transient long swigCPtr;
  protected transient boolean swigCMemOwn;

  protected session_params(long cPtr, boolean cMemoryOwn) {
    swigCMemOwn = cMemoryOwn;
    swigCPtr = cPtr;
  }

  protected static long getCPtr(session_params obj) {
    return (obj == null) ? 0 : obj.swigCPtr;
  }

  protected static long swigRelease(session_params obj) {
    long ptr = 0;
    if (obj != null) {
      if (!obj.swigCMemOwn)
        throw new RuntimeException("Cannot release ownership as memory is not owned");
      ptr = obj.swigCPtr;
      obj.swigCMemOwn = false;
      obj.delete();
    }
    return ptr;
  }

  @SuppressWarnings("deprecation")
  protected void finalize() {
    delete();
  }

  public synchronized void delete() {
    if (swigCPtr != 0) {
      if (swigCMemOwn) {
        swigCMemOwn = false;
        libtorrent_jni.delete_session_params(swigCPtr);
      }
      swigCPtr = 0;
    }
  }

  public session_params(settings_pack sp) {
    this(libtorrent_jni.new_session_params__SWIG_0(settings_pack.getCPtr(sp), sp), true);
  }

  public session_params() {
    this(libtorrent_jni.new_session_params__SWIG_1(), true);
  }

  public session_params(session_params arg0) {
    this(libtorrent_jni.new_session_params__SWIG_2(session_params.getCPtr(arg0), arg0), true);
  }

  public void setSettings(settings_pack value) {
    libtorrent_jni.session_params_settings_set(swigCPtr, this, settings_pack.getCPtr(value), value);
  }

  public settings_pack getSettings() {
    long cPtr = libtorrent_jni.session_params_settings_get(swigCPtr, this);
    return (cPtr == 0) ? null : new settings_pack(cPtr, false);
  }

  public void setDht_settings(dht_settings value) {
    libtorrent_jni.session_params_dht_settings_set(swigCPtr, this, dht_settings.getCPtr(value), value);
  }

  public dht_settings getDht_settings() {
    long cPtr = libtorrent_jni.session_params_dht_settings_get(swigCPtr, this);
    return (cPtr == 0) ? null : new dht_settings(cPtr, false);
  }

  public void setDht_state(dht_state value) {
    libtorrent_jni.session_params_dht_state_set(swigCPtr, this, dht_state.getCPtr(value), value);
  }

  public dht_state getDht_state() {
    long cPtr = libtorrent_jni.session_params_dht_state_get(swigCPtr, this);
    return (cPtr == 0) ? null : new dht_state(cPtr, false);
  }

}
