Skip to content

InscoperAPI/Build/Java/com.inscoper.api/com/inscoper/api/SubDeviceId.java

Packages

Name
com.inscoper.api

Classes

Name
class com.inscoper.api.SubDeviceId
SubDeviceId class uniquely identifies a sub-device.

Source code

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

package com.inscoper.api;
import com.inscoper.api.logging.*;

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

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

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

  protected static long swigRelease(SubDeviceId 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", "removal"})
  protected void finalize() {
    delete();
  }

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

    @Override
    public boolean equals(Object obj) {
        if (this == obj)
            return true;
        if (obj == null)
            return false;
        if (getClass() != obj.getClass())
            return false;
        SubDeviceId other = (SubDeviceId) obj;
        return equals(other);
    }

    private int hash = 0;

    @Override
    public int hashCode() {
        if(hash == 0) {
            final int prime = 31;
            hash = 1;
            hash = prime * hash + ((getSubDeviceId() == null) ? 0 : getSubDeviceId().hashCode());
            hash = prime * hash + ((getDeviceId() == null) ? 0 : getDeviceId().hashCode());
        }
        return hash;
    }

    @Override
    public String toString() {
        return getName();
    }

  public SubDeviceId() {
    this(InscoperJNI.new_SubDeviceId__SWIG_0(), true);
  }

  public SubDeviceId(String deviceId, String subDeviceId) {
    this(InscoperJNI.new_SubDeviceId__SWIG_1(deviceId, subDeviceId), true);
  }

  public String getDeviceId() {
    return InscoperJNI.SubDeviceId_getDeviceId(swigCPtr, this);
  }

  public void setDeviceId(String deviceId) {
    InscoperJNI.SubDeviceId_setDeviceId(swigCPtr, this, deviceId);
  }

  public String getSubDeviceId() {
    return InscoperJNI.SubDeviceId_getSubDeviceId(swigCPtr, this);
  }

  public void setSubDeviceId(String subDeviceId) {
    InscoperJNI.SubDeviceId_setSubDeviceId(swigCPtr, this, subDeviceId);
  }

  public String getName() {
    return InscoperJNI.SubDeviceId_getName(swigCPtr, this);
  }

  private boolean equals(SubDeviceId other) {
    return InscoperJNI.SubDeviceId_equals(swigCPtr, this, SubDeviceId.getCPtr(other), other);
  }

}

Updated on 2026-09-03 at 12:14:19 +0200