Class FacetRangeBuilder

java.lang.Object
com.commercetools.api.models.product.FacetRangeBuilder
All Implemented Interfaces:
Builder<FacetRange>
Direct Known Subclasses:
FacetResultRangeBuilder

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

     FacetRange facetRange = FacetRange.builder()
             .from(0.3)
             .fromStr("{fromStr}")
             .to(0.3)
             .toStr("{toStr}")
             .count(0.3)
             .total(0.3)
             .min(0.3)
             .max(0.3)
             .mean(0.3)
             .build()
 
  • Constructor Details

    • FacetRangeBuilder

      public FacetRangeBuilder()
  • Method Details

    • from

      public FacetRangeBuilder from(Double from)
      set the value to the from
      Parameters:
      from - value to be set
      Returns:
      Builder
    • fromStr

      public FacetRangeBuilder fromStr(String fromStr)
      set the value to the fromStr
      Parameters:
      fromStr - value to be set
      Returns:
      Builder
    • to

      public FacetRangeBuilder to(Double to)
      set the value to the to
      Parameters:
      to - value to be set
      Returns:
      Builder
    • toStr

      public FacetRangeBuilder toStr(String toStr)
      set the value to the toStr
      Parameters:
      toStr - value to be set
      Returns:
      Builder
    • count

      public FacetRangeBuilder count(Long count)
      set the value to the count
      Parameters:
      count - value to be set
      Returns:
      Builder
    • productCount

      public FacetRangeBuilder productCount(@Nullable Long productCount)
      set the value to the productCount
      Parameters:
      productCount - value to be set
      Returns:
      Builder
    • total

      public FacetRangeBuilder total(Double total)
      set the value to the total
      Parameters:
      total - value to be set
      Returns:
      Builder
    • min

      public FacetRangeBuilder min(Double min)
      set the value to the min
      Parameters:
      min - value to be set
      Returns:
      Builder
    • max

      public FacetRangeBuilder max(Double max)
      set the value to the max
      Parameters:
      max - value to be set
      Returns:
      Builder
    • mean

      public FacetRangeBuilder mean(Double mean)
      set the value to the mean
      Parameters:
      mean - value to be set
      Returns:
      Builder
    • getFrom

      public Double getFrom()
      value of from}
      Returns:
      from
    • getFromStr

      public String getFromStr()
      value of fromStr}
      Returns:
      fromStr
    • getTo

      public Double getTo()
      value of to}
      Returns:
      to
    • getToStr

      public String getToStr()
      value of toStr}
      Returns:
      toStr
    • getCount

      public Long getCount()
      value of count}
      Returns:
      count
    • getProductCount

      @Nullable public Long getProductCount()
      value of productCount}
      Returns:
      productCount
    • getTotal

      public Double getTotal()
      value of total}
      Returns:
      total
    • getMin

      public Double getMin()
      value of min}
      Returns:
      min
    • getMax

      public Double getMax()
      value of max}
      Returns:
      max
    • getMean

      public Double getMean()
      value of mean}
      Returns:
      mean
    • build

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

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

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

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