Class QueryIndex
- java.lang.Object
-
- com.couchbase.client.java.manager.query.QueryIndex
-
public class QueryIndex extends Object
Describes a N1QL index.
-
-
Constructor Summary
Constructors Constructor Description QueryIndex(JsonObject raw)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Optional<String>condition()Return theStringrepresentation of the index's condition (the WHERE clause of the index), or an empty Optional if no condition was set.booleanequals(Object o)inthashCode()JsonArrayindexKey()Return anarrayof Strings that represent the index key(s).Stringkeyspace()Stringname()Stringnamespace()Optional<String>partition()If present, returns the configured partition for the index.booleanprimary()JsonObjectraw()Stringstate()StringtoString()Stringtype()
-
-
-
Constructor Detail
-
QueryIndex
public QueryIndex(JsonObject raw)
-
-
Method Detail
-
primary
public boolean primary()
-
name
public String name()
-
type
public String type()
-
state
public String state()
-
keyspace
public String keyspace()
- Returns:
- the keyspace for the index, typically the bucket name.
-
namespace
public String namespace()
- Returns:
- the namespace for the index. A namespace is a resource pool that contains multiple keyspaces.
- See Also:
keyspace()
-
indexKey
public JsonArray indexKey()
Return anarrayof Strings that represent the index key(s). The array is empty in the case of a PRIMARY INDEX. Note that the query service can present the key in a slightly different manner from when you declared the index: for instance, it will show the indexed fields in an escaped format (surrounded by backticks).- Returns:
- an array of Strings that represent the index key(s), or an empty array in the case of a PRIMARY index.
-
condition
public Optional<String> condition()
Return theStringrepresentation of the index's condition (the WHERE clause of the index), or an empty Optional if no condition was set.Note that the query service can present the condition in a slightly different manner from when you declared the index: for instance it will wrap expressions with parentheses and show the fields in an escaped format (surrounded by backticks).
- Returns:
- the condition/WHERE clause of the index or empty string if none.
-
partition
public Optional<String> partition()
If present, returns the configured partition for the index.- Returns:
- the partition if set, empty if none.
-
raw
public JsonObject raw()
- Returns:
- the raw JSON representation of the index information, as returned by the query service.
-
-