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

package com.robotraconteur;

public class ServicePathSegment {
  private transient long swigCPtr;
  protected transient boolean swigCMemOwn;

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

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

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

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

  public ServicePathSegment() {
    this(RobotRaconteurJavaJNI.new_ServicePathSegment__SWIG_0(), true);
  }

  public ServicePathSegment(String name) {
    this(RobotRaconteurJavaJNI.new_ServicePathSegment__SWIG_1(name), true);
  }

  public ServicePathSegment(String name, String index) {
    this(RobotRaconteurJavaJNI.new_ServicePathSegment__SWIG_2(name, index), true);
  }

  public void setName(String value) {
    RobotRaconteurJavaJNI.ServicePathSegment_name_set(swigCPtr, this, value);
  }

  public String getName() {
    return RobotRaconteurJavaJNI.ServicePathSegment_name_get(swigCPtr, this);
  }

  public void setIndex(SWIGTYPE_p_boost__optionalT_std__string_t value) {
    RobotRaconteurJavaJNI.ServicePathSegment_index_set(swigCPtr, this, SWIGTYPE_p_boost__optionalT_std__string_t.getCPtr(value));
  }

  public SWIGTYPE_p_boost__optionalT_std__string_t getIndex() {
    long cPtr = RobotRaconteurJavaJNI.ServicePathSegment_index_get(swigCPtr, this);
    return (cPtr == 0) ? null : new SWIGTYPE_p_boost__optionalT_std__string_t(cPtr, false);
  }

}
