Class ProductProjectionPagedSearchResponseBuilder

java.lang.Object
com.commercetools.api.models.product.ProductProjectionPagedSearchResponseBuilder
All Implemented Interfaces:
Builder<ProductProjectionPagedSearchResponse>

public class ProductProjectionPagedSearchResponseBuilder extends Object implements Builder<ProductProjectionPagedSearchResponse>
ProductProjectionPagedSearchResponseBuilder
Example to create an instance using the builder pattern

     ProductProjectionPagedSearchResponse productProjectionPagedSearchResponse = ProductProjectionPagedSearchResponse.builder()
             .limit(0.3)
             .offset(0.3)
             .count(0.3)
             .plusResults(resultsBuilder -> resultsBuilder)
             .build()
 
  • Constructor Details

    • ProductProjectionPagedSearchResponseBuilder

      public ProductProjectionPagedSearchResponseBuilder()
  • Method Details

    • limit

      The maximum number of results returned on a page.

      Parameters:
      limit - value to be set
      Returns:
      Builder
    • offset

      The starting point for the retrieved paginated result.

      Parameters:
      offset - value to be set
      Returns:
      Builder
    • count

      Actual number of results returned.

      Parameters:
      count - value to be set
      Returns:
      Builder
    • total

      Total number of results matching the query.

      Parameters:
      total - value to be set
      Returns:
      Builder
    • results

      ProductProjections where at least one ProductVariant matches the search query, provided with the text.{language} and/or filter.query or filter query parameter. If the query parameter markMatchingVariants=true was provided with the request, the matching variants are marked as such.

      Parameters:
      results - value to be set
      Returns:
      Builder
    • results

      ProductProjections where at least one ProductVariant matches the search query, provided with the text.{language} and/or filter.query or filter query parameter. If the query parameter markMatchingVariants=true was provided with the request, the matching variants are marked as such.

      Parameters:
      results - value to be set
      Returns:
      Builder
    • plusResults

      ProductProjections where at least one ProductVariant matches the search query, provided with the text.{language} and/or filter.query or filter query parameter. If the query parameter markMatchingVariants=true was provided with the request, the matching variants are marked as such.

      Parameters:
      results - value to be set
      Returns:
      Builder
    • plusResults

      ProductProjections where at least one ProductVariant matches the search query, provided with the text.{language} and/or filter.query or filter query parameter. If the query parameter markMatchingVariants=true was provided with the request, the matching variants are marked as such.

      Parameters:
      builder - function to build the results value
      Returns:
      Builder
    • withResults

      ProductProjections where at least one ProductVariant matches the search query, provided with the text.{language} and/or filter.query or filter query parameter. If the query parameter markMatchingVariants=true was provided with the request, the matching variants are marked as such.

      Parameters:
      builder - function to build the results value
      Returns:
      Builder
    • addResults

      ProductProjections where at least one ProductVariant matches the search query, provided with the text.{language} and/or filter.query or filter query parameter. If the query parameter markMatchingVariants=true was provided with the request, the matching variants are marked as such.

      Parameters:
      builder - function to build the results value
      Returns:
      Builder
    • setResults

      ProductProjections where at least one ProductVariant matches the search query, provided with the text.{language} and/or filter.query or filter query parameter. If the query parameter markMatchingVariants=true was provided with the request, the matching variants are marked as such.

      Parameters:
      builder - function to build the results value
      Returns:
      Builder
    • facets

      Facet results for each facet expression specified in the search request.

      Only present if at least one facet parameter was provided with the search request.

      Parameters:
      builder - function to build the facets value
      Returns:
      Builder
    • withFacets

      Facet results for each facet expression specified in the search request.

      Only present if at least one facet parameter was provided with the search request.

      Parameters:
      builder - function to build the facets value
      Returns:
      Builder
    • facets

      Facet results for each facet expression specified in the search request.

      Only present if at least one facet parameter was provided with the search request.

      Parameters:
      facets - value to be set
      Returns:
      Builder
    • getLimit

      public Long getLimit()

      The maximum number of results returned on a page.

      Returns:
      limit
    • getOffset

      public Long getOffset()

      The starting point for the retrieved paginated result.

      Returns:
      offset
    • getCount

      public Long getCount()

      Actual number of results returned.

      Returns:
      count
    • getTotal

      @Nullable public Long getTotal()

      Total number of results matching the query.

      Returns:
      total
    • getResults

      public List<ProductProjection> getResults()

      ProductProjections where at least one ProductVariant matches the search query, provided with the text.{language} and/or filter.query or filter query parameter. If the query parameter markMatchingVariants=true was provided with the request, the matching variants are marked as such.

      Returns:
      results
    • getFacets

      @Nullable public FacetResults getFacets()

      Facet results for each facet expression specified in the search request.

      Only present if at least one facet parameter was provided with the search request.

      Returns:
      facets
    • build

      builds ProductProjectionPagedSearchResponse with checking for non-null required values
      Specified by:
      build in interface Builder<ProductProjectionPagedSearchResponse>
      Returns:
      ProductProjectionPagedSearchResponse
    • buildUnchecked

      public ProductProjectionPagedSearchResponse buildUnchecked()
      builds ProductProjectionPagedSearchResponse without checking for non-null required values
      Returns:
      ProductProjectionPagedSearchResponse
    • of

      factory method for an instance of ProductProjectionPagedSearchResponseBuilder
      Returns:
      builder
    • of

      create builder for ProductProjectionPagedSearchResponse instance
      Parameters:
      template - instance with prefilled values for the builder
      Returns:
      builder