/* ----------------------------------------------------------------------------
 * 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 MessageHeader extends RRValue {
  private transient long swigCPtr;
  private transient boolean swigCMemOwnDerived;

  protected MessageHeader(long cPtr, boolean cMemoryOwn) {
    super(RobotRaconteurJavaJNI.MessageHeader_SWIGSmartPtrUpcast(cPtr), true);
    swigCMemOwnDerived = cMemoryOwn;
    swigCPtr = cPtr;
  }

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

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

  public synchronized void delete() {
    if(swigCPtr != 0 && swigCMemOwnDerived) {
      swigCMemOwnDerived = false;
      RobotRaconteurJavaJNI.delete_MessageHeader(swigCPtr);
    }
    swigCPtr = 0;
    super.delete();
  }

  public void setHeaderSize(int value) {
    RobotRaconteurJavaJNI.MessageHeader_HeaderSize_set(swigCPtr, this, value);
  }

  public int getHeaderSize() {
    return RobotRaconteurJavaJNI.MessageHeader_HeaderSize_get(swigCPtr, this);
  }

  public void setMessageFlags(short value) {
    RobotRaconteurJavaJNI.MessageHeader_MessageFlags_set(swigCPtr, this, value);
  }

  public short getMessageFlags() {
    return RobotRaconteurJavaJNI.MessageHeader_MessageFlags_get(swigCPtr, this);
  }

  public void setSenderEndpoint(long value) {
    RobotRaconteurJavaJNI.MessageHeader_SenderEndpoint_set(swigCPtr, this, value);
  }

  public long getSenderEndpoint() {
    return RobotRaconteurJavaJNI.MessageHeader_SenderEndpoint_get(swigCPtr, this);
  }

  public void setReceiverEndpoint(long value) {
    RobotRaconteurJavaJNI.MessageHeader_ReceiverEndpoint_set(swigCPtr, this, value);
  }

  public long getReceiverEndpoint() {
    return RobotRaconteurJavaJNI.MessageHeader_ReceiverEndpoint_get(swigCPtr, this);
  }

  public void setSenderNodeName(String value) {
    RobotRaconteurJavaJNI.MessageHeader_SenderNodeName_set(swigCPtr, this, value);
  }

  public String getSenderNodeName() {
    return RobotRaconteurJavaJNI.MessageHeader_SenderNodeName_get(swigCPtr, this);
  }

  public void setReceiverNodeName(String value) {
    RobotRaconteurJavaJNI.MessageHeader_ReceiverNodeName_set(swigCPtr, this, value);
  }

  public String getReceiverNodeName() {
    return RobotRaconteurJavaJNI.MessageHeader_ReceiverNodeName_get(swigCPtr, this);
  }

  public void setSenderNodeID(NodeID value) {
    RobotRaconteurJavaJNI.MessageHeader_SenderNodeID_set(swigCPtr, this, NodeID.getCPtr(value), value);
  }

  public NodeID getSenderNodeID() {
    long cPtr = RobotRaconteurJavaJNI.MessageHeader_SenderNodeID_get(swigCPtr, this);
    return (cPtr == 0) ? null : new NodeID(cPtr, false);
  }

  public void setReceiverNodeID(NodeID value) {
    RobotRaconteurJavaJNI.MessageHeader_ReceiverNodeID_set(swigCPtr, this, NodeID.getCPtr(value), value);
  }

  public NodeID getReceiverNodeID() {
    long cPtr = RobotRaconteurJavaJNI.MessageHeader_ReceiverNodeID_get(swigCPtr, this);
    return (cPtr == 0) ? null : new NodeID(cPtr, false);
  }

  public void setMetaData(String value) {
    RobotRaconteurJavaJNI.MessageHeader_MetaData_set(swigCPtr, this, value);
  }

  public String getMetaData() {
    return RobotRaconteurJavaJNI.MessageHeader_MetaData_get(swigCPtr, this);
  }

  public void setEntryCount(int value) {
    RobotRaconteurJavaJNI.MessageHeader_EntryCount_set(swigCPtr, this, value);
  }

  public int getEntryCount() {
    return RobotRaconteurJavaJNI.MessageHeader_EntryCount_get(swigCPtr, this);
  }

  public void setMessageID(int value) {
    RobotRaconteurJavaJNI.MessageHeader_MessageID_set(swigCPtr, this, value);
  }

  public int getMessageID() {
    return RobotRaconteurJavaJNI.MessageHeader_MessageID_get(swigCPtr, this);
  }

  public void setMessageResID(int value) {
    RobotRaconteurJavaJNI.MessageHeader_MessageResID_set(swigCPtr, this, value);
  }

  public int getMessageResID() {
    return RobotRaconteurJavaJNI.MessageHeader_MessageResID_get(swigCPtr, this);
  }

  public void setMessageSize(long value) {
    RobotRaconteurJavaJNI.MessageHeader_MessageSize_set(swigCPtr, this, value);
  }

  public long getMessageSize() {
    return RobotRaconteurJavaJNI.MessageHeader_MessageSize_get(swigCPtr, this);
  }

  public void setPriority(int value) {
    RobotRaconteurJavaJNI.MessageHeader_Priority_set(swigCPtr, this, value);
  }

  public int getPriority() {
    return RobotRaconteurJavaJNI.MessageHeader_Priority_get(swigCPtr, this);
  }

  public void setExtended(vector_uint8_t value) {
    RobotRaconteurJavaJNI.MessageHeader_Extended_set(swigCPtr, this, vector_uint8_t.getCPtr(value), value);
  }

  public vector_uint8_t getExtended() {
    long cPtr = RobotRaconteurJavaJNI.MessageHeader_Extended_get(swigCPtr, this);
    return (cPtr == 0) ? null : new vector_uint8_t(cPtr, false);
  }

  public int computeSize() {
    return RobotRaconteurJavaJNI.MessageHeader_computeSize(swigCPtr, this);
  }

  public void updateHeader(long message_size, int entry_count) {
    RobotRaconteurJavaJNI.MessageHeader_updateHeader(swigCPtr, this, message_size, entry_count);
  }

  public MessageHeader() {
    this(RobotRaconteurJavaJNI.new_MessageHeader(), true);
  }

}
