Class DefaultView

java.lang.Object
com.couchbase.client.java.view.DefaultView
All Implemented Interfaces:
View

public class DefaultView
extends Object
implements View
Implementation of a regular, non spatial view.
Since:
2.0.0
Author:
Michael Nitschinger
  • Constructor Details

  • Method Details

    • create

      public static View create​(String name, String map, String reduce)
      Create a new representation of a regular, non-spatial view.
      Parameters:
      name - the name of the view.
      map - the map function (javascript) for the view.
      reduce - the reduce function (prebuilt name or custom javascript) for the view. Use create(String, String) or null if you don't need one.
      Returns:
      the view object.
    • create

      public static View create​(String name, String map)
      Create a new representation of a regular, non-spatial view without reduce function.
      Parameters:
      name - the name of the view.
      map - the map function (javascript) for the view.
      Returns:
      the view object.
    • name

      public String name()
      Description copied from interface: View
      The name of the view.
      Specified by:
      name in interface View
      Returns:
      the name.
    • map

      public String map()
      Description copied from interface: View
      The map function
      Specified by:
      map in interface View
      Returns:
      map function.
    • reduce

      public String reduce()
      Description copied from interface: View
      The reduce function.
      Specified by:
      reduce in interface View
      Returns:
      reduce function, or null if none is set.
    • hasReduce

      public boolean hasReduce()
      Description copied from interface: View
      If a reduce function is set or not.
      Specified by:
      hasReduce in interface View
      Returns:
      true if it is, false otherwise.
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

      public boolean equals​(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object