Class DesignDocument
java.lang.Object
com.couchbase.client.java.manager.view.DesignDocument
A collection of named
View
s.-
Constructor Summary
ConstructorDescriptionDesignDocument
(String name) Creates a new design document with the given name and no views.DesignDocument
(String name, Map<String, View> views) Creates a new design document with the given name and views. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Returns the view with the given name, if it exists.int
hashCode()
name()
Returns the name of the design document.Assigns a new name to this design document.Convenience method for adding a view to this design document (replacing any existing view with the same name).Convenience method for adding a view to this design document (replacing any existing view with the same name).Convenience method for adding a view to this design document (replacing any existing view with the same name).removeView
(String name) Removes the view with the give name, if it exists.toString()
views()
Returns the views in this document indexed by name.Sets all of the views for this design document, overriding any existing views.
-
Constructor Details
-
DesignDocument
Creates a new design document with the given name and no views.- Parameters:
name
- name for the design document
-
DesignDocument
Creates a new design document with the given name and views.- Parameters:
name
- name for the design documentviews
- map from view name to view
-
-
Method Details
-
name
Returns the name of the design document. -
views
Returns the views in this document indexed by name. Changes to the returned map affect the document, so for example you can remove all views by callingmyDesignDoc.views().clear()
. -
putView
Convenience method for adding a view to this design document (replacing any existing view with the same name). -
putView
Convenience method for adding a view to this design document (replacing any existing view with the same name). -
putView
Convenience method for adding a view to this design document (replacing any existing view with the same name). -
getView
Returns the view with the given name, if it exists.- Parameters:
name
- name of the view to return
-
removeView
Removes the view with the give name, if it exists.- Parameters:
name
- name of the view to remove- Returns:
- the design document, for method chaining.
-
name
Assigns a new name to this design document.- Parameters:
name
- new name for the design document.- Returns:
- the design document, for method chaining.
-
views
Sets all of the views for this design document, overriding any existing views.- Parameters:
views
- map from view name to view- Returns:
- the design document, for method chaining.
-
toString
-
equals
-
hashCode
public int hashCode()
-