Class FacetResultsBuilder

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

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

     FacetResults facetResults = FacetResults.builder()
             ./^[a-z].*$/(/^[a-z].*$/Builder -> /^[a-z].*$/Builder)
             .build()
 
  • Constructor Details

    • FacetResultsBuilder

      public FacetResultsBuilder()
  • Method Details

    • values

      public FacetResultsBuilder values(Map<String,FacetResult> values)
      assign pattern properties to the builder
      Parameters:
      values - properties to be set
      Returns:
      Builder
    • addValue

      public FacetResultsBuilder addValue(String key, FacetResult value)
      assign a pattern property to the builder
      Parameters:
      key - property name
      value - property value
      Returns:
      Builder
    • getValues

      public Map<String,FacetResult> getValues()
      values of pattern properties
      Returns:
      pattern properties
    • build

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

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

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

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