com.google.appengine.api.search
Class FacetRequest
- java.lang.Object
-
- com.google.appengine.api.search.FacetRequest
-
public final class FacetRequest extends java.lang.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:
FacetRequest request = FacetRequest.newBuilder().setName("wine_type") .addValueConstraint("white").addValueConstraint("red").build();
and to request ranges: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 and Description static class
FacetRequest.Builder
A facet request builder.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method and Description java.lang.String
getName()
Returns the name of the face in this request.java.util.List<FacetRange>
getRanges()
Returns an unmodifiable list ofFacetRange
s.java.util.List<java.lang.String>
getValueConstraints()
Returns an unmodifiable list of value constraints.java.lang.Integer
getValueLimit()
Returns the maximum number of values this facet should have.static FacetRequest.Builder
newBuilder()
Creates and returns aFacetRequest
builder.static FacetRequest.Builder
newBuilder(FacetRequest request)
Creates a builder from the given FacetRequest.java.lang.String
toString()
-
-
-
Method Detail
-
newBuilder
public static FacetRequest.Builder newBuilder()
Creates and returns aFacetRequest
builder. Set the facet request parameters and use theFacetRequest.Builder.build()
method to create a concrete instance of FacetRequest.- Returns:
- a
FacetRequest.Builder
which 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 java.lang.String getName()
Returns the name of the face in this request.
-
getValueLimit
public java.lang.Integer getValueLimit()
Returns the maximum number of values this facet should have. Null if the value limit is not set.
-
getRanges
public java.util.List<FacetRange> getRanges()
Returns an unmodifiable list ofFacetRange
s.
-
getValueConstraints
public java.util.List<java.lang.String> getValueConstraints()
Returns an unmodifiable list of value constraints.
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-