com.couchbase.client.protocol.views
Class View

java.lang.Object
  extended by com.couchbase.client.protocol.views.AbstractView
      extended by com.couchbase.client.protocol.views.View

public class View
extends AbstractView

Represents a View definition inside the Couchbase cluster. This class knows whether the view contains "map" and/or "reduce" functions. It also is able to generate the URI representation of itself to be used against the cluster. Also, instances of a View can be used in combination with DesignDocuments to actually create them.


Constructor Summary
View(java.lang.String database, java.lang.String designDoc, java.lang.String viewName, boolean map, boolean reduce)
          Create a new View object.
 
Method Summary
 java.lang.String getURI()
          Returns the URI/String representation of the View.
 boolean hasMap()
          Checks if the view has a "map" method defined.
 boolean hasReduce()
          Checks if the view has a "reduce" method defined.
 
Methods inherited from class com.couchbase.client.protocol.views.AbstractView
getDatabaseName, getDesignDocumentName, getViewName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

View

public View(java.lang.String database,
            java.lang.String designDoc,
            java.lang.String viewName,
            boolean map,
            boolean reduce)
Create a new View object.

Parameters:
database - the name of the database.
designDoc - the name of the corresponding design document.
viewName - the name of the view itself.
map - if the View contains a map function or not.
reduce - if the View contains a reduce function or not.
Method Detail

hasMap

public boolean hasMap()
Checks if the view has a "map" method defined.

Specified by:
hasMap in class AbstractView
Returns:
true if it has a "map" method defined, false otherwise.

hasReduce

public boolean hasReduce()
Checks if the view has a "reduce" method defined.

Specified by:
hasReduce in class AbstractView
Returns:
true if it has a "reduce" method defined, false otherwise.

getURI

public java.lang.String getURI()
Returns the URI/String representation of the View.

Specified by:
getURI in class AbstractView
Returns:
the URI path of the View to query against the cluster.


Copyright © 2006-2009 Dustin Sallings, 2009-2012 Couchbase, Inc.