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

package com.nanotec.nanolib;

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

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

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

  protected static long swigRelease(ProfinetDevice obj) {
    long ptr = 0;
    if (obj != null) {
      if (!obj.swigCMemOwn)
        throw new RuntimeException("Cannot release ownership as memory is not owned");
      ptr = obj.swigCPtr;
      obj.swigCMemOwn = false;
      obj.delete();
    }
    return ptr;
  }

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

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

  public void setDeviceName(String value) {
    NanolibJNI.ProfinetDevice_deviceName_set(swigCPtr, this, value);
  }

  public String getDeviceName() {
    return NanolibJNI.ProfinetDevice_deviceName_get(swigCPtr, this);
  }

  public void setDeviceVendor(String value) {
    NanolibJNI.ProfinetDevice_deviceVendor_set(swigCPtr, this, value);
  }

  public String getDeviceVendor() {
    return NanolibJNI.ProfinetDevice_deviceVendor_get(swigCPtr, this);
  }

  public void setMacAddress(MacAddress value) {
    NanolibJNI.ProfinetDevice_macAddress_set(swigCPtr, this, MacAddress.getCPtr(value), value);
  }

  public MacAddress getMacAddress() {
    long cPtr = NanolibJNI.ProfinetDevice_macAddress_get(swigCPtr, this);
    return (cPtr == 0) ? null : new MacAddress(cPtr, false);
  }

  public void setIpAddress(long value) {
    NanolibJNI.ProfinetDevice_ipAddress_set(swigCPtr, this, value);
  }

  public long getIpAddress() {
    return NanolibJNI.ProfinetDevice_ipAddress_get(swigCPtr, this);
  }

  public void setNetMask(long value) {
    NanolibJNI.ProfinetDevice_netMask_set(swigCPtr, this, value);
  }

  public long getNetMask() {
    return NanolibJNI.ProfinetDevice_netMask_get(swigCPtr, this);
  }

  public void setDefaultGateway(long value) {
    NanolibJNI.ProfinetDevice_defaultGateway_set(swigCPtr, this, value);
  }

  public long getDefaultGateway() {
    return NanolibJNI.ProfinetDevice_defaultGateway_get(swigCPtr, this);
  }

  public ProfinetDevice() {
    this(NanolibJNI.new_ProfinetDevice(), true);
  }

}
