Class AssetSourceBuilder

java.lang.Object
com.commercetools.history.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}")
             .key("{key}")
             .dimensions(dimensionsBuilder -> dimensionsBuilder)
             .contentType("{contentType}")
             .build()
 
  • Constructor Details

    • AssetSourceBuilder

      public AssetSourceBuilder()
  • Method Details

    • uri

      public AssetSourceBuilder uri(String uri)
      set the value to the uri
      Parameters:
      uri - value to be set
      Returns:
      Builder
    • key

      public AssetSourceBuilder key(String key)
      set the value to the key
      Parameters:
      key - value to be set
      Returns:
      Builder
    • dimensions

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

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

      public AssetSourceBuilder dimensions(AssetDimensions dimensions)
      set the value to the dimensions
      Parameters:
      dimensions - value to be set
      Returns:
      Builder
    • contentType

      public AssetSourceBuilder contentType(String contentType)
      set the value to the contentType
      Parameters:
      contentType - value to be set
      Returns:
      Builder
    • getUri

      public String getUri()
      value of uri}
      Returns:
      uri
    • getKey

      public String getKey()
      value of key}
      Returns:
      key
    • getDimensions

      public AssetDimensions getDimensions()
      value of dimensions}
      Returns:
      dimensions
    • getContentType

      public String getContentType()
      value of contentType}
      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