/* ----------------------------------------------------------------------------
 * This file was automatically generated by SWIG (http://www.swig.org).
 * Version 1.3.35
 *
 * Do not make changes to this file unless you know what you are doing--modify
 * the SWIG interface file instead.
 * ----------------------------------------------------------------------------- */

package org.freeswitch.esl;

public class ESLevent {
  private long swigCPtr;
  protected boolean swigCMemOwn;

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

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

  protected void finalize() {
    delete();
  }

  public synchronized void delete() {
    if(swigCPtr != 0 && swigCMemOwn) {
      swigCMemOwn = false;
      eslJNI.delete_ESLevent(swigCPtr);
    }
    swigCPtr = 0;
  }

  public void setEvent(SWIGTYPE_p_esl_event_t value) {
    eslJNI.ESLevent_event_set(swigCPtr, this, SWIGTYPE_p_esl_event_t.getCPtr(value));
  }

  public SWIGTYPE_p_esl_event_t getEvent() {
    long cPtr = eslJNI.ESLevent_event_get(swigCPtr, this);
    return (cPtr == 0) ? null : new SWIGTYPE_p_esl_event_t(cPtr, false);
  }

  public void setSerialized_string(String value) {
    eslJNI.ESLevent_serialized_string_set(swigCPtr, this, value);
  }

  public String getSerialized_string() {
    return eslJNI.ESLevent_serialized_string_get(swigCPtr, this);
  }

  public void setMine(int value) {
    eslJNI.ESLevent_mine_set(swigCPtr, this, value);
  }

  public int getMine() {
    return eslJNI.ESLevent_mine_get(swigCPtr, this);
  }

  public ESLevent(String type, String subclass_name) {
    this(eslJNI.new_ESLevent__SWIG_0(type, subclass_name), true);
  }

  public ESLevent(SWIGTYPE_p_esl_event_t wrap_me, int free_me) {
    this(eslJNI.new_ESLevent__SWIG_1(SWIGTYPE_p_esl_event_t.getCPtr(wrap_me), free_me), true);
  }

  public ESLevent(ESLevent me) {
    this(eslJNI.new_ESLevent__SWIG_2(ESLevent.getCPtr(me), me), true);
  }

  public String serialize(String format) {
    return eslJNI.ESLevent_serialize(swigCPtr, this, format);
  }

  public boolean setPriority(SWIGTYPE_p_esl_priority_t priority) {
    return eslJNI.ESLevent_setPriority(swigCPtr, this, SWIGTYPE_p_esl_priority_t.getCPtr(priority));
  }

  public String getHeader(String header_name, int idx) {
    return eslJNI.ESLevent_getHeader(swigCPtr, this, header_name, idx);
  }

  public String getBody() {
    return eslJNI.ESLevent_getBody(swigCPtr, this);
  }

  public String getType() {
    return eslJNI.ESLevent_getType(swigCPtr, this);
  }

  public boolean addBody(String value) {
    return eslJNI.ESLevent_addBody(swigCPtr, this, value);
  }

  public boolean addHeader(String header_name, String value) {
    return eslJNI.ESLevent_addHeader(swigCPtr, this, header_name, value);
  }

  public boolean pushHeader(String header_name, String value) {
    return eslJNI.ESLevent_pushHeader(swigCPtr, this, header_name, value);
  }

  public boolean unshiftHeader(String header_name, String value) {
    return eslJNI.ESLevent_unshiftHeader(swigCPtr, this, header_name, value);
  }

  public boolean delHeader(String header_name) {
    return eslJNI.ESLevent_delHeader(swigCPtr, this, header_name);
  }

  public String firstHeader() {
    return eslJNI.ESLevent_firstHeader(swigCPtr, this);
  }

  public String nextHeader() {
    return eslJNI.ESLevent_nextHeader(swigCPtr, this);
  }

}
