Class FacetTermBuilder

java.lang.Object
com.commercetools.api.models.product.FacetTermBuilder
All Implemented Interfaces:
Builder<FacetTerm>
Direct Known Subclasses:
FacetResultTermBuilder

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

     FacetTerm facetTerm = FacetTerm.builder()
             .count(0.3)
             .build()
 
  • Constructor Details

    • FacetTermBuilder

      public FacetTermBuilder()
  • Method Details

    • term

      public FacetTermBuilder term(Object term)

      Value for the field specified in the term facet expression for which at least one ProductVariant could be found. For AttributeNumberType Attributes, numeric values are returned as decimals, for example 1.0 instead of 1.

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

      public FacetTermBuilder count(Long count)

      Number of ProductVariants for which the term applies.

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

      public FacetTermBuilder productCount(@Nullable Long productCount)

      Number of Products for which the term applies. Only available if the counting products extension is enabled.

      Parameters:
      productCount - value to be set
      Returns:
      Builder
    • getTerm

      public Object getTerm()

      Value for the field specified in the term facet expression for which at least one ProductVariant could be found. For AttributeNumberType Attributes, numeric values are returned as decimals, for example 1.0 instead of 1.

      Returns:
      term
    • getCount

      public Long getCount()

      Number of ProductVariants for which the term applies.

      Returns:
      count
    • getProductCount

      @Nullable public Long getProductCount()

      Number of Products for which the term applies. Only available if the counting products extension is enabled.

      Returns:
      productCount
    • build

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

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

      public static FacetTermBuilder of()
      factory method for an instance of FacetTermBuilder
      Returns:
      builder
    • of

      public static FacetTermBuilder of(FacetTerm template)
      create builder for FacetTerm instance
      Parameters:
      template - instance with prefilled values for the builder
      Returns:
      builder