Class DefaultHitLocations
- java.lang.Object
-
- com.couchbase.client.java.search.result.hits.DefaultHitLocations
-
- All Implemented Interfaces:
HitLocations
@Uncommitted @Public public class DefaultHitLocations extends Object implements HitLocations
A default implementation of aHitLocations
.- Since:
- 2.3.0
- Author:
- Simon Baslé, Michael Nitschinger
-
-
Constructor Summary
Constructors Constructor Description DefaultHitLocations()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description HitLocations
add(HitLocation l)
add a location and allow method chaininglong
count()
size of all()List<String>
fields()
list the fields in this locationstatic HitLocations
from(JsonObject locationsJson)
Parses a FTS JSON representation of aHitLocations
.List<HitLocation>
get(String field)
list all locations for a given field (any term)List<HitLocation>
get(String field, String term)
list all locations for a given field and termList<HitLocation>
getAll()
list all locations (any field, any term)Set<String>
terms()
list all terms in this locations, considering all fields (so a set)List<String>
termsFor(String field)
list the terms for a given fieldString
toString()
-
-
-
Method Detail
-
add
public HitLocations add(HitLocation l)
Description copied from interface:HitLocations
add a location and allow method chaining- Specified by:
add
in interfaceHitLocations
-
get
public List<HitLocation> get(String field)
Description copied from interface:HitLocations
list all locations for a given field (any term)- Specified by:
get
in interfaceHitLocations
-
get
public List<HitLocation> get(String field, String term)
Description copied from interface:HitLocations
list all locations for a given field and term- Specified by:
get
in interfaceHitLocations
-
getAll
public List<HitLocation> getAll()
Description copied from interface:HitLocations
list all locations (any field, any term)- Specified by:
getAll
in interfaceHitLocations
-
count
public long count()
Description copied from interface:HitLocations
size of all()- Specified by:
count
in interfaceHitLocations
-
fields
public List<String> fields()
Description copied from interface:HitLocations
list the fields in this location- Specified by:
fields
in interfaceHitLocations
-
termsFor
public List<String> termsFor(String field)
Description copied from interface:HitLocations
list the terms for a given field- Specified by:
termsFor
in interfaceHitLocations
-
terms
public Set<String> terms()
Description copied from interface:HitLocations
list all terms in this locations, considering all fields (so a set)- Specified by:
terms
in interfaceHitLocations
-
from
public static HitLocations from(JsonObject locationsJson)
Parses a FTS JSON representation of aHitLocations
.
-
-