Class ProductSearchFacetResultStatsBuilder

java.lang.Object
com.commercetools.api.models.product_search.ProductSearchFacetResultStatsBuilder
All Implemented Interfaces:
Builder<ProductSearchFacetResultStats>

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

     ProductSearchFacetResultStats productSearchFacetResultStats = ProductSearchFacetResultStats.builder()
             .name("{name}")
             .count(0.3)
             .build()
 
  • Constructor Details

    • ProductSearchFacetResultStatsBuilder

      public ProductSearchFacetResultStatsBuilder()
  • Method Details

    • name

      Name of the facet.

      Parameters:
      name - value to be set
      Returns:
      Builder
    • min

      The minimum value of the field, scoped to the faceted results.

      Parameters:
      min - value to be set
      Returns:
      Builder
    • max

      The maximum value of the field, scoped to the faceted results.

      Parameters:
      max - value to be set
      Returns:
      Builder
    • mean

      public ProductSearchFacetResultStatsBuilder mean(@Nullable Object mean)

      The average value of the field calculated as sum / count.

      Only returned for number fields.

      Parameters:
      mean - value to be set
      Returns:
      Builder
    • sum

      public ProductSearchFacetResultStatsBuilder sum(@Nullable Object sum)

      The sum of values of the field that match the facet expression.

      Only returned for number fields.

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

      The total number of values counted that match the facet expression.

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

      public String getName()

      Name of the facet.

      Returns:
      name
    • getMin

      public Object getMin()

      The minimum value of the field, scoped to the faceted results.

      Returns:
      min
    • getMax

      public Object getMax()

      The maximum value of the field, scoped to the faceted results.

      Returns:
      max
    • getMean

      @Nullable public Object getMean()

      The average value of the field calculated as sum / count.

      Only returned for number fields.

      Returns:
      mean
    • getSum

      @Nullable public Object getSum()

      The sum of values of the field that match the facet expression.

      Only returned for number fields.

      Returns:
      sum
    • getCount

      public Long getCount()

      The total number of values counted that match the facet expression.

      Returns:
      count
    • build

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

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

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

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