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

net.ravendb.client.documents.session.operations.lazy.LazyClusterTransactionOperations Maven / Gradle / Ivy

There is a newer version: 6.0.1
Show newest version
package net.ravendb.client.documents.session.operations.lazy;

import net.ravendb.client.documents.Lazy;
import net.ravendb.client.documents.operations.compareExchange.CompareExchangeValue;
import net.ravendb.client.documents.session.ClusterTransactionOperationsBase;
import net.ravendb.client.documents.session.DocumentSession;
import net.ravendb.client.documents.session.ILazyClusterTransactionOperations;

import java.util.Map;
import java.util.function.Consumer;

@SuppressWarnings("unchecked")
public class LazyClusterTransactionOperations extends ClusterTransactionOperationsBase implements ILazyClusterTransactionOperations {

    public LazyClusterTransactionOperations(DocumentSession session) {
        super(session);
    }

    @Override
    public  Lazy> getCompareExchangeValue(Class clazz, String key) {
        return session.addLazyOperation((Class>)(Class)CompareExchangeValue.class,
                new LazyGetCompareExchangeValueOperation<>(this, clazz, session.getConventions(), key), null);
    }

    @Override
    public  Lazy> getCompareExchangeValue(Class clazz, String key, Consumer> onEval) {
        return session.addLazyOperation((Class>)(Class)CompareExchangeValue.class,
                new LazyGetCompareExchangeValueOperation<>(this, clazz, session.getConventions(), key), onEval);
    }

    @Override
    public  Lazy>> getCompareExchangeValues(Class clazz, String[] keys) {
        return session.addLazyOperation((Class>>)(Class)Map.class,
                new LazyGetCompareExchangeValuesOperation<>(this, clazz, session.getConventions(), keys), null);
    }

    @Override
    public  Lazy>> getCompareExchangeValues(Class clazz, String[] keys, Consumer>> onEval) {
        return session.addLazyOperation((Class>>)(Class)Map.class,
                new LazyGetCompareExchangeValuesOperation<>(this, clazz, session.getConventions(), keys), onEval);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy