com.couchbase.client.java.view.AsyncViewResult Maven / Gradle / Ivy
/*
* Copyright (c) 2016 Couchbase, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.couchbase.client.java.view;
import com.couchbase.client.core.annotations.InterfaceAudience;
import com.couchbase.client.core.annotations.InterfaceStability;
import com.couchbase.client.java.document.json.JsonObject;
import rx.Observable;
/**
* Represents the result from a {@link ViewQuery}.
*
* @author Michael Nitschinger
* @since 2.0
*/
@InterfaceStability.Committed
@InterfaceAudience.Public
public interface AsyncViewResult {
/**
* Emits one {@link AsyncViewRow} for each row received from the view.
*
* @return a (potentially empty) {@link Observable} containing view rows.
*/
Observable rows();
/**
* The total number of rows.
*
* @return number of rows.
*/
int totalRows();
/**
* If the query was successful.
*
* @return true if it was, false otherwise.
*/
boolean success();
/**
* If it was not successful, an error is contained here.
*
* @return the potential error.
*/
Observable error();
/**
* If debug was enabled on the query, it is contained here.
*
* @return the debug info.
*/
JsonObject debug();
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy