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

com.ironcorelabs.sdk.PolicyCachingConfig Maven / Gradle / Ivy

There is a newer version: 0.16.0
Show newest version
// Automatically generated by rust_swig
package com.ironcorelabs.sdk;

/**
 * Policy evaluation caching config
 * 
 * Since policies are evaluated by the webservice, caching the result can greatly speed
 * up encrypting a document with a PolicyGrant.
 */
public final class PolicyCachingConfig {
    /**
     * @param maxEntries  maximum number of policy evaluations that will be cached by the SDK.
     * If the maximum number is exceeded, the cache will be cleared prior to storing the next entry.
     */
    public PolicyCachingConfig(long maxEntries) {
        mNativeObj = init(maxEntries);
    }
    private static native long init(long maxEntries);

    public PolicyCachingConfig() {
        mNativeObj = init();
    }
    private static native long init();

    public final long getMaxEntries() {
        long ret = do_getMaxEntries(mNativeObj);

        return ret;
    }
    private static native long do_getMaxEntries(long self);

    public final int hashCode() {
        int ret = do_hashCode(mNativeObj);

        return ret;
    }
    private static native int do_hashCode(long self);

    private final boolean rustEq(PolicyCachingConfig o) {
        long a0 = o.mNativeObj;
        boolean ret = do_rustEq(mNativeObj, a0);

        JNIReachabilityFence.reachabilityFence1(o);

        return ret;
    }
    private static native boolean do_rustEq(long self, long o);

    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*/ PolicyCachingConfig(InternalPointerMarker marker, long ptr) {
        assert marker == InternalPointerMarker.RAW_PTR;
        this.mNativeObj = ptr;
    }
    /*package*/ long mNativeObj;

    public boolean equals(Object obj) {
        if(obj instanceof PolicyCachingConfig){
            PolicyCachingConfig other = (PolicyCachingConfig) obj;
            return other.rustEq(this);
        }
        return false;
    }
    }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy