Package com.google.appengine.api.search
Class FacetRequest
- java.lang.Object
-
- com.google.appengine.api.search.FacetRequest
-
public final class FacetRequest extends Object
A facet request representing parameters for requesting specific facets to be returned with a query result.For example, to request a facet with a name and specific values:
and to request ranges:FacetRequest request = FacetRequest.newBuilder().setName("wine_type") .addValueConstraint("white").addValueConstraint("red").build();FacetRequest request = FacetRequest.newBuilder().setName("year") .addRange(null, 2000.0) // year < 2000.0 .addRange(1980.0, 2000.0) // 1980.0 <= year < 2000.0 .addRange(2000.0, null).build(); // year >= 2000.0
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classFacetRequest.BuilderA facet request builder.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetName()Returns the name of the face in this request.List<FacetRange>getRanges()Returns an unmodifiable list ofFacetRanges.List<String>getValueConstraints()Returns an unmodifiable list of value constraints.IntegergetValueLimit()Returns the maximum number of values this facet should have.static FacetRequest.BuildernewBuilder()Creates and returns aFacetRequestbuilder.static FacetRequest.BuildernewBuilder(FacetRequest request)Creates a builder from the given FacetRequest.StringtoString()
-
-
-
Method Detail
-
newBuilder
public static FacetRequest.Builder newBuilder()
Creates and returns aFacetRequestbuilder. Set the facet request parameters and use theFacetRequest.Builder.build()method to create a concrete instance of FacetRequest.- Returns:
- a
FacetRequest.Builderwhich can construct a facet request
-
newBuilder
public static FacetRequest.Builder newBuilder(FacetRequest request)
Creates a builder from the given FacetRequest.- Parameters:
request- the facet request for the builder to use to build another request.- Returns:
- a new builder with values set from the given request
-
getName
public String getName()
Returns the name of the face in this request.
-
getValueLimit
public Integer getValueLimit()
Returns the maximum number of values this facet should have. Null if the value limit is not set.
-
getRanges
public List<FacetRange> getRanges()
Returns an unmodifiable list ofFacetRanges.
-
getValueConstraints
public List<String> getValueConstraints()
Returns an unmodifiable list of value constraints.
-
-