/* ----------------------------------------------------------------------------
 * 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 TryGetValueResult {
  private transient long swigCPtr;
  protected transient boolean swigCMemOwn;

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

  protected static long getCPtr(TryGetValueResult 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_TryGetValueResult(swigCPtr);
      }
      swigCPtr = 0;
    }
  }

  public void setRes(boolean value) {
    RobotRaconteurJavaJNI.TryGetValueResult_res_set(swigCPtr, this, value);
  }

  public boolean getRes() {
    return RobotRaconteurJavaJNI.TryGetValueResult_res_get(swigCPtr, this);
  }

  public void setValue(MessageElement value) {
    RobotRaconteurJavaJNI.TryGetValueResult_value_set(swigCPtr, this, MessageElement.getCPtr(value), value);
  }

  public MessageElement getValue() {
    long cPtr = RobotRaconteurJavaJNI.TryGetValueResult_value_get(swigCPtr, this);
    return (cPtr == 0) ? null : new MessageElement(cPtr, true);
  }

  public void setTs(TimeSpec value) {
    RobotRaconteurJavaJNI.TryGetValueResult_ts_set(swigCPtr, this, TimeSpec.getCPtr(value), value);
  }

  public TimeSpec getTs() {
    long cPtr = RobotRaconteurJavaJNI.TryGetValueResult_ts_get(swigCPtr, this);
    return (cPtr == 0) ? null : new TimeSpec(cPtr, false);
  }

  public TryGetValueResult() {
    this(RobotRaconteurJavaJNI.new_TryGetValueResult(), true);
  }

}
