Class TermFacetResultBuilder

java.lang.Object
com.commercetools.api.models.product.TermFacetResultBuilder
All Implemented Interfaces:
io.vrap.rmf.base.client.Builder<TermFacetResult>

public class TermFacetResultBuilder extends Object implements io.vrap.rmf.base.client.Builder<TermFacetResult>
TermFacetResultBuilder
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()
 
  • Constructor Details

    • TermFacetResultBuilder

      public TermFacetResultBuilder()
  • Method Details

    • dataType

      public TermFacetResultBuilder dataType(TermFacetResultType dataType)
      set the value to the dataType
      Parameters:
      dataType - value to be set
      Returns:
      Builder
    • missing

      public TermFacetResultBuilder missing(Long missing)
      set the value to the missing
      Parameters:
      missing - value to be set
      Returns:
      Builder
    • total

      public TermFacetResultBuilder total(Long total)
      set the value to the total
      Parameters:
      total - value to be set
      Returns:
      Builder
    • other

      public TermFacetResultBuilder other(Long other)
      set the value to the other
      Parameters:
      other - value to be set
      Returns:
      Builder
    • terms

      public TermFacetResultBuilder terms(FacetTerm... terms)
      set values to the terms
      Parameters:
      terms - value to be set
      Returns:
      Builder
    • terms

      public TermFacetResultBuilder terms(List<FacetTerm> terms)
      set value to the terms
      Parameters:
      terms - value to be set
      Returns:
      Builder
    • plusTerms

      public TermFacetResultBuilder plusTerms(FacetTerm... terms)
      add values to the terms
      Parameters:
      terms - value to be set
      Returns:
      Builder
    • plusTerms

      add the value to the terms using the builder function
      Parameters:
      builder - function to build the terms value
      Returns:
      Builder
    • withTerms

      set the value to the terms using the builder function
      Parameters:
      builder - function to build the terms value
      Returns:
      Builder
    • addTerms

      add the value to the terms using the builder function
      Parameters:
      builder - function to build the terms value
      Returns:
      Builder
    • setTerms

      set the value to the terms using the builder function
      Parameters:
      builder - function to build the terms value
      Returns:
      Builder
    • getDataType

      public TermFacetResultType getDataType()
      value of dataType}
      Returns:
      dataType
    • getMissing

      public Long getMissing()
      value of missing}
      Returns:
      missing
    • getTotal

      public Long getTotal()
      value of total}
      Returns:
      total
    • getOther

      public Long getOther()
      value of other}
      Returns:
      other
    • getTerms

      public List<FacetTerm> getTerms()
      value of terms}
      Returns:
      terms
    • build

      public TermFacetResult build()
      builds TermFacetResult with checking for non-null required values
      Specified by:
      build in interface io.vrap.rmf.base.client.Builder<TermFacetResult>
      Returns:
      TermFacetResult
    • buildUnchecked

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

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

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