All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.mindoo.domino.jna.internal.Handle Maven / Gradle / Ivy

There is a newer version: 0.9.53
Show newest version
package com.mindoo.domino.jna.internal;

import com.mindoo.domino.jna.IAdaptable;
import com.mindoo.domino.jna.utils.PlatformUtils;

public class Handle implements IAdaptable {
	private long m_hdl64;
	private int m_hdl32;
	
	public Handle(long hdl) {
		if (PlatformUtils.is32Bit())
			throw new IllegalStateException("Constructor is 64bit only");
		m_hdl64 = hdl;
	}
	
	public Handle(int hdl) {
		if (PlatformUtils.is64Bit())
			throw new IllegalStateException("Constructor is 32bit only");
		m_hdl32 = hdl;
	}
	
	public long getHandle64() {
		return m_hdl64;
	}
	
	public int getHandle32() {
		return m_hdl32;
	}

	@Override
	public  T getAdapter(Class clazz) {
		if (Handle.class.equals(clazz)) {
			return (T) this;
		}
		return null;
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy