Class HitBuilder

java.lang.Object
com.commercetools.api.models.order.HitBuilder
All Implemented Interfaces:
Builder<Hit>

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

     Hit hit = Hit.builder()
             .id("{id}")
             .version(0.3)
             .build()
 
  • Constructor Details

    • HitBuilder

      public HitBuilder()
  • Method Details

    • id

      public HitBuilder id(String id)

      Unique identifier of the Order.

      Parameters:
      id - value to be set
      Returns:
      Builder
    • version

      public HitBuilder version(Long version)

      Current version of the Order.

      Parameters:
      version - value to be set
      Returns:
      Builder
    • relevance

      public HitBuilder relevance(@Nullable Double relevance)

      The higher the value is, the more relevant the hit is for the search request.

      Parameters:
      relevance - value to be set
      Returns:
      Builder
    • getId

      public String getId()

      Unique identifier of the Order.

      Returns:
      id
    • getVersion

      public Long getVersion()

      Current version of the Order.

      Returns:
      version
    • getRelevance

      @Nullable public Double getRelevance()

      The higher the value is, the more relevant the hit is for the search request.

      Returns:
      relevance
    • build

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

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

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

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