Interface TermFacetResult

All Superinterfaces:
FacetResult

public interface TermFacetResult extends FacetResult
TermFacetResult
Example to create an instance using the builder pattern

     TermFacetResult termFacetResult = TermFacetResult.builder()
             .dataType(TermFacetResultType.TEXT)
             .missing(0.3)
             .total(0.3)
             .other(0.3)
             .plusTerms(termsBuilder -> termsBuilder)
             .build()
 
  • Field Details

  • Method Details

    • getDataType

      @NotNull @NotNull TermFacetResultType getDataType()

      Data type to which the facet is applied.

      Returns:
      dataType
    • getMissing

      @NotNull @NotNull Long getMissing()

      Number of ProductVariants that have no value for the specified term facet expression.

      Returns:
      missing
    • getTotal

      @NotNull @NotNull Long getTotal()

      Number of terms matching the term facet expression.

      • If the expression refers to Product fields like categories.id and reviewRatingStatistics.count, the value represents the number of Products.
      • If the expression is defined for fields specific to Product Variants, for example, variants.attributes.{name}, the value represents the number of Product Variants matching the expression.
      Returns:
      total
    • getOther

      @NotNull @NotNull Long getOther()

      Number of terms not represented in this object (such as the number of terms beyond the limit).

      Returns:
      other
    • getTerms

      @NotNull @Valid @NotNull @Valid List<FacetTerm> getTerms()

      Values for the field specified in term facet expression for which at least one ProductVariant could be found.

      By default, facet terms are returned in a descending order of their count.

      If the term facet expression specifies to count Products through the counting products extension, then facet terms are returned in a descending order of their productCount.

      Returns:
      terms
    • setDataType

      void setDataType(TermFacetResultType dataType)

      Data type to which the facet is applied.

      Parameters:
      dataType - value to be set
    • setMissing

      void setMissing(Long missing)

      Number of ProductVariants that have no value for the specified term facet expression.

      Parameters:
      missing - value to be set
    • setTotal

      void setTotal(Long total)

      Number of terms matching the term facet expression.

      • If the expression refers to Product fields like categories.id and reviewRatingStatistics.count, the value represents the number of Products.
      • If the expression is defined for fields specific to Product Variants, for example, variants.attributes.{name}, the value represents the number of Product Variants matching the expression.
      Parameters:
      total - value to be set
    • setOther

      void setOther(Long other)

      Number of terms not represented in this object (such as the number of terms beyond the limit).

      Parameters:
      other - value to be set
    • setTerms

      void setTerms(FacetTerm... terms)

      Values for the field specified in term facet expression for which at least one ProductVariant could be found.

      By default, facet terms are returned in a descending order of their count.

      If the term facet expression specifies to count Products through the counting products extension, then facet terms are returned in a descending order of their productCount.

      Parameters:
      terms - values to be set
    • setTerms

      void setTerms(List<FacetTerm> terms)

      Values for the field specified in term facet expression for which at least one ProductVariant could be found.

      By default, facet terms are returned in a descending order of their count.

      If the term facet expression specifies to count Products through the counting products extension, then facet terms are returned in a descending order of their productCount.

      Parameters:
      terms - values to be set
    • of

      static TermFacetResult of()
      factory method
      Returns:
      instance of TermFacetResult
    • of

      static TermFacetResult of(TermFacetResult template)
      factory method to create a shallow copy TermFacetResult
      Parameters:
      template - instance to be copied
      Returns:
      copy instance
    • copyDeep

      TermFacetResult copyDeep()
      Specified by:
      copyDeep in interface FacetResult
    • deepCopy

      @Nullable static TermFacetResult deepCopy(@Nullable TermFacetResult template)
      factory method to create a deep copy of TermFacetResult
      Parameters:
      template - instance to be copied
      Returns:
      copy instance
    • builder

      static TermFacetResultBuilder builder()
      builder factory method for TermFacetResult
      Returns:
      builder
    • builder

      static TermFacetResultBuilder builder(TermFacetResult template)
      create builder for TermFacetResult instance
      Parameters:
      template - instance with prefilled values for the builder
      Returns:
      builder
    • withTermFacetResult

      default <T> T withTermFacetResult(Function<TermFacetResult,T> helper)
      accessor map function
      Type Parameters:
      T - mapped type
      Parameters:
      helper - function to map the object
      Returns:
      mapped value
    • typeReference

      static com.fasterxml.jackson.core.type.TypeReference<TermFacetResult> typeReference()
      gives a TypeReference for usage with Jackson DataBind
      Returns:
      TypeReference