com.alibaba.fastffi.llvm.Optional_cxx_0x5e17d10c Maven / Gradle / Ivy
The newest version!
package com.alibaba.fastffi.llvm;
import com.alibaba.fastffi.CXXReference;
import com.alibaba.fastffi.FFIForeignType;
import com.alibaba.fastffi.FFIPointerImpl;
import com.alibaba.fastffi.FFISynthetic;
import com.alibaba.fastffi.FFITypeFactory;
import java.lang.Long;
import java.lang.Object;
import java.lang.String;
import java.lang.UnsatisfiedLinkError;
@FFIForeignType("llvm::Optional")
@FFISynthetic("com.alibaba.fastffi.llvm.Optional")
public class Optional_cxx_0x5e17d10c extends FFIPointerImpl implements Optional {
public static final int SIZE;
public static final int HASH_SHIFT;
static {
try {
System.loadLibrary("llvm4jni");
} catch (UnsatisfiedLinkError e) {
System.load(FFITypeFactory.findNativeLibrary(Optional_cxx_0x5e17d10c.class, "llvm4jni"));
}
}
static {
SIZE = _elementSize$$$();
assert SIZE > 0;
HASH_SHIFT = 31 - Integer.numberOfLeadingZeros(1 + SIZE);
assert HASH_SHIFT > 0;
}
public Optional_cxx_0x5e17d10c(final long address) {
super(address);
}
private static final native int _elementSize$$$();
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
Optional_cxx_0x5e17d10c that = (Optional_cxx_0x5e17d10c) o;
return this.address == that.address;
}
public int hashCode() {
return (int) (address >> HASH_SHIFT);
}
public String toString() {
return getClass().getName() + "@" + Long.toHexString(address);
}
@CXXReference
public Long getValue() {
return new java.lang.Long(nativeGetValue(address));
}
@CXXReference
public static native long nativeGetValue(long ptr);
public boolean hasValue() {
return nativeHasValue(address);
}
public static native boolean nativeHasValue(long ptr);
}