@Stability.Volatile public class DesignDocument extends Object
View
s.Constructor and Description |
---|
DesignDocument(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.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object o) |
Optional<View> |
getView(String name)
Returns the view with the given name, if it exists.
|
int |
hashCode() |
String |
name()
Returns the name of the design document.
|
DesignDocument |
name(String name)
Assigns a new name to this design document.
|
DesignDocument |
putView(String name,
String map)
Convenience method for adding a view to this design document (replacing any existing view with the same name).
|
DesignDocument |
putView(String name,
String map,
String reduce)
Convenience method for adding a view to this design document (replacing any existing view with the same name).
|
DesignDocument |
putView(String name,
View view)
Convenience method for adding a view to this design document (replacing any existing view with the same name).
|
DesignDocument |
removeView(String name)
Removes the view with the give name, if it exists.
|
String |
toString() |
Map<String,View> |
views()
Returns the views in this document indexed by name.
|
DesignDocument |
views(Map<String,View> views)
Sets all of the views for this design document, overriding any existing views.
|
public DesignDocument(String name)
name
- name for the design documentpublic String name()
public Map<String,View> views()
myDesignDoc.views().clear()
.public DesignDocument putView(String name, String map)
public DesignDocument putView(String name, String map, String reduce)
public DesignDocument putView(String name, View view)
public Optional<View> getView(String name)
name
- name of the view to returnpublic DesignDocument removeView(String name)
name
- name of the view to removepublic DesignDocument name(String name)
name
- new name for the design document.public DesignDocument views(Map<String,View> views)
views
- map from view name to viewCopyright © 2021 Couchbase, Inc.. All rights reserved.