ActionConfig.java 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. /* ----------------------------------------------------------------------------
  2. * This file was automatically generated by SWIG (http://www.swig.org).
  3. * Version 2.0.9
  4. *
  5. * Do not make changes to this file unless you know what you are doing--modify
  6. * the SWIG interface file instead.
  7. * ----------------------------------------------------------------------------- */
  8. package org.doubango.tinyWRAP;
  9. public class ActionConfig {
  10. private long swigCPtr;
  11. protected boolean swigCMemOwn;
  12. protected ActionConfig(long cPtr, boolean cMemoryOwn) {
  13. swigCMemOwn = cMemoryOwn;
  14. swigCPtr = cPtr;
  15. }
  16. protected static long getCPtr(ActionConfig obj) {
  17. return (obj == null) ? 0 : obj.swigCPtr;
  18. }
  19. protected void finalize() {
  20. delete();
  21. }
  22. public synchronized void delete() {
  23. if (swigCPtr != 0) {
  24. if (swigCMemOwn) {
  25. swigCMemOwn = false;
  26. tinyWRAPJNI.delete_ActionConfig(swigCPtr);
  27. }
  28. swigCPtr = 0;
  29. }
  30. }
  31. public ActionConfig() {
  32. this(tinyWRAPJNI.new_ActionConfig(), true);
  33. }
  34. public boolean addHeader(String name, String value) {
  35. return tinyWRAPJNI.ActionConfig_addHeader(swigCPtr, this, name, value);
  36. }
  37. public boolean addPayload(java.nio.ByteBuffer payload, long len) {
  38. return tinyWRAPJNI.ActionConfig_addPayload(swigCPtr, this, payload, len);
  39. }
  40. public boolean setActiveMedia(twrap_media_type_t type) {
  41. return tinyWRAPJNI.ActionConfig_setActiveMedia(swigCPtr, this, type.swigValue());
  42. }
  43. public ActionConfig setResponseLine(short code, String phrase) {
  44. long cPtr = tinyWRAPJNI.ActionConfig_setResponseLine(swigCPtr, this, code, phrase);
  45. return (cPtr == 0) ? null : new ActionConfig(cPtr, false);
  46. }
  47. public ActionConfig setMediaString(twrap_media_type_t type, String key, String value) {
  48. long cPtr = tinyWRAPJNI.ActionConfig_setMediaString(swigCPtr, this, type.swigValue(), key, value);
  49. return (cPtr == 0) ? null : new ActionConfig(cPtr, false);
  50. }
  51. public ActionConfig setMediaInt(twrap_media_type_t type, String key, int value) {
  52. long cPtr = tinyWRAPJNI.ActionConfig_setMediaInt(swigCPtr, this, type.swigValue(), key, value);
  53. return (cPtr == 0) ? null : new ActionConfig(cPtr, false);
  54. }
  55. }