net.ravendb.client.documents.session.operations.lazy.LazyRevisionOperations Maven / Gradle / Ivy
package net.ravendb.client.documents.session.operations.lazy;
import net.ravendb.client.documents.Lazy;
import net.ravendb.client.documents.session.DocumentSession;
import net.ravendb.client.documents.session.ILazyRevisionsOperations;
import net.ravendb.client.documents.session.operations.GetRevisionOperation;
import net.ravendb.client.json.MetadataAsDictionary;
import java.util.Date;
import java.util.List;
import java.util.Map;
public class LazyRevisionOperations implements ILazyRevisionsOperations {
protected final DocumentSession delegate;
public LazyRevisionOperations(DocumentSession delegate) {
this.delegate = delegate;
}
@Override
public Lazy get(Class clazz, String changeVector) {
GetRevisionOperation operation = new GetRevisionOperation(delegate, changeVector);
LazyRevisionOperation lazyRevisionOperation = new LazyRevisionOperation<>(clazz, operation, LazyRevisionOperation.Mode.SINGLE);
return delegate.addLazyOperation(clazz, lazyRevisionOperation, null);
}
@Override
public Lazy> getMetadataFor(String id) {
return getMetadataFor(id, 0, 25);
}
@Override
public Lazy> getMetadataFor(String id, int start) {
return getMetadataFor(id, start, 25);
}
@SuppressWarnings("unchecked")
@Override
public Lazy> getMetadataFor(String id, int start, int pageSize) {
GetRevisionOperation operation = new GetRevisionOperation(delegate, id, start, pageSize);
LazyRevisionOperation lazyRevisionOperation = new LazyRevisionOperation<>(MetadataAsDictionary.class, operation, LazyRevisionOperation.Mode.LIST_OF_METADATA);
return delegate.addLazyOperation((Class>)(Class>)List.class, lazyRevisionOperation, null);
}
@SuppressWarnings("unchecked")
@Override
public Lazy
© 2015 - 2024 Weber Informatics LLC | Privacy Policy