Class AssetSourceBuilder

java.lang.Object
com.commercetools.api.models.common.AssetSourceBuilder
All Implemented Interfaces:
Builder<AssetSource>

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

     AssetSource assetSource = AssetSource.builder()
             .uri("{uri}")
             .build()
 
  • Constructor Details

    • AssetSourceBuilder

      public AssetSourceBuilder()
  • Method Details

    • uri

      public AssetSourceBuilder uri(String uri)

      URI of the AssetSource.

      Parameters:
      uri - value to be set
      Returns:
      Builder
    • key

      User-defined identifier of the AssetSource. Must be unique per Asset.

      Parameters:
      key - value to be set
      Returns:
      Builder
    • dimensions

      Width and height of the AssetSource.

      Parameters:
      builder - function to build the dimensions value
      Returns:
      Builder
    • withDimensions

      Width and height of the AssetSource.

      Parameters:
      builder - function to build the dimensions value
      Returns:
      Builder
    • dimensions

      public AssetSourceBuilder dimensions(@Nullable AssetDimensions dimensions)

      Width and height of the AssetSource.

      Parameters:
      dimensions - value to be set
      Returns:
      Builder
    • contentType

      public AssetSourceBuilder contentType(@Nullable String contentType)

      Indicates the type of content, for example application/pdf.

      Parameters:
      contentType - value to be set
      Returns:
      Builder
    • getUri

      public String getUri()

      URI of the AssetSource.

      Returns:
      uri
    • getKey

      @Nullable public String getKey()

      User-defined identifier of the AssetSource. Must be unique per Asset.

      Returns:
      key
    • getDimensions

      @Nullable public AssetDimensions getDimensions()

      Width and height of the AssetSource.

      Returns:
      dimensions
    • getContentType

      @Nullable public String getContentType()

      Indicates the type of content, for example application/pdf.

      Returns:
      contentType
    • build

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

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

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

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