com.ironcorelabs.sdk.PolicyGrant Maven / Gradle / Ivy
// Automatically generated by rust_swig
package com.ironcorelabs.sdk;
public final class PolicyGrant {
public PolicyGrant() {
mNativeObj = init();
}
private static native long init();
public PolicyGrant(Category a0, Sensitivity a1, DataSubject a2, UserId a3) {
long a00 = 0;//TODO: use ptr::null() for corresponding constant
if (a0 != null) {
a00 = a0.mNativeObj;
a0.mNativeObj = 0;
}
long a10 = 0;//TODO: use ptr::null() for corresponding constant
if (a1 != null) {
a10 = a1.mNativeObj;
a1.mNativeObj = 0;
}
long a20 = 0;//TODO: use ptr::null() for corresponding constant
if (a2 != null) {
a20 = a2.mNativeObj;
a2.mNativeObj = 0;
}
long a30 = 0;//TODO: use ptr::null() for corresponding constant
if (a3 != null) {
a30 = a3.mNativeObj;
a3.mNativeObj = 0;
}
mNativeObj = init(a00, a10, a20, a30);
JNIReachabilityFence.reachabilityFence4(a0, a1, a2, a3);
}
private static native long init(long a0, long a1, long a2, long a3);
public final java.util.Optional category() {
long ret = do_category(mNativeObj);
java.util.Optional convRet;
if (ret != 0) {
convRet = java.util.Optional.of(new Category(InternalPointerMarker.RAW_PTR, ret));
} else {
convRet = java.util.Optional.empty();
}
return convRet;
}
private static native long do_category(long self);
public final java.util.Optional sensitivity() {
long ret = do_sensitivity(mNativeObj);
java.util.Optional convRet;
if (ret != 0) {
convRet = java.util.Optional.of(new Sensitivity(InternalPointerMarker.RAW_PTR, ret));
} else {
convRet = java.util.Optional.empty();
}
return convRet;
}
private static native long do_sensitivity(long self);
public final java.util.Optional dataSubject() {
long ret = do_dataSubject(mNativeObj);
java.util.Optional convRet;
if (ret != 0) {
convRet = java.util.Optional.of(new DataSubject(InternalPointerMarker.RAW_PTR, ret));
} else {
convRet = java.util.Optional.empty();
}
return convRet;
}
private static native long do_dataSubject(long self);
public final java.util.Optional substituteId() {
long ret = do_substituteId(mNativeObj);
java.util.Optional convRet;
if (ret != 0) {
convRet = java.util.Optional.of(new UserId(InternalPointerMarker.RAW_PTR, ret));
} else {
convRet = java.util.Optional.empty();
}
return convRet;
}
private static native long do_substituteId(long self);
public synchronized void delete() {
if (mNativeObj != 0) {
do_delete(mNativeObj);
mNativeObj = 0;
}
}
@Override
protected void finalize() throws Throwable {
try {
delete();
}
finally {
super.finalize();
}
}
private static native void do_delete(long me);
/*package*/ PolicyGrant(InternalPointerMarker marker, long ptr) {
assert marker == InternalPointerMarker.RAW_PTR;
this.mNativeObj = ptr;
}
/*package*/ long mNativeObj;
}