Class AssetBuilder

java.lang.Object
com.commercetools.importapi.models.common.AssetBuilder
All Implemented Interfaces:
io.vrap.rmf.base.client.Builder<Asset>

public class AssetBuilder extends Object implements io.vrap.rmf.base.client.Builder<Asset>
AssetBuilder
Example to create an instance using the builder pattern

     Asset asset = Asset.builder()
             .key("{key}")
             .plusSources(sourcesBuilder -> sourcesBuilder)
             .name(nameBuilder -> nameBuilder)
             .build()
 
  • Constructor Details

  • Method Details

    • key

      public AssetBuilder key(String key)

      User-defined identifier for the asset. Asset keys are unique inside their container (a product variant or a category).

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

      public AssetBuilder sources(AssetSource... sources)
      set values to the sources
      Parameters:
      sources - value to be set
      Returns:
      Builder
    • sources

      public AssetBuilder sources(List<AssetSource> sources)
      set value to the sources
      Parameters:
      sources - value to be set
      Returns:
      Builder
    • plusSources

      public AssetBuilder plusSources(AssetSource... sources)
      add values to the sources
      Parameters:
      sources - value to be set
      Returns:
      Builder
    • plusSources

      add the value to the sources using the builder function
      Parameters:
      builder - function to build the sources value
      Returns:
      Builder
    • withSources

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

      add the value to the sources using the builder function
      Parameters:
      builder - function to build the sources value
      Returns:
      Builder
    • setSources

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

      A localized string is a JSON object where the keys are of IETF language tag, and the values the corresponding strings used for that language.

      {
          "de": "Hundefutter",
          "en": "dog food"
        }
        
      Parameters:
      builder - function to build the name value
      Returns:
      Builder
    • withName

      A localized string is a JSON object where the keys are of IETF language tag, and the values the corresponding strings used for that language.

      {
          "de": "Hundefutter",
          "en": "dog food"
        }
        
      Parameters:
      builder - function to build the name value
      Returns:
      Builder
    • name

      A localized string is a JSON object where the keys are of IETF language tag, and the values the corresponding strings used for that language.

      {
          "de": "Hundefutter",
          "en": "dog food"
        }
        
      Parameters:
      name - value to be set
      Returns:
      Builder
    • description

      A localized string is a JSON object where the keys are of IETF language tag, and the values the corresponding strings used for that language.

      {
          "de": "Hundefutter",
          "en": "dog food"
        }
        
      Parameters:
      builder - function to build the description value
      Returns:
      Builder
    • withDescription

      A localized string is a JSON object where the keys are of IETF language tag, and the values the corresponding strings used for that language.

      {
          "de": "Hundefutter",
          "en": "dog food"
        }
        
      Parameters:
      builder - function to build the description value
      Returns:
      Builder
    • description

      A localized string is a JSON object where the keys are of IETF language tag, and the values the corresponding strings used for that language.

      {
          "de": "Hundefutter",
          "en": "dog food"
        }
        
      Parameters:
      description - value to be set
      Returns:
      Builder
    • tags

      public AssetBuilder tags(@Nullable String... tags)
      set values to the tags
      Parameters:
      tags - value to be set
      Returns:
      Builder
    • tags

      set value to the tags
      Parameters:
      tags - value to be set
      Returns:
      Builder
    • plusTags

      add values to the tags
      Parameters:
      tags - value to be set
      Returns:
      Builder
    • custom

      The representation to be sent to the server when creating a resource with custom fields.

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

      The representation to be sent to the server when creating a resource with custom fields.

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

      The representation to be sent to the server when creating a resource with custom fields.

      Parameters:
      custom - value to be set
      Returns:
      Builder
    • getKey

      public String getKey()

      User-defined identifier for the asset. Asset keys are unique inside their container (a product variant or a category).

      Returns:
      key
    • getSources

      value of sources}
      Returns:
      sources
    • getName

      A localized string is a JSON object where the keys are of IETF language tag, and the values the corresponding strings used for that language.

      {
          "de": "Hundefutter",
          "en": "dog food"
        }
        
      Returns:
      name
    • getDescription

      A localized string is a JSON object where the keys are of IETF language tag, and the values the corresponding strings used for that language.

      {
          "de": "Hundefutter",
          "en": "dog food"
        }
        
      Returns:
      description
    • getTags

      value of tags}
      Returns:
      tags
    • getCustom

      The representation to be sent to the server when creating a resource with custom fields.

      Returns:
      custom
    • build

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

      builds Asset without checking for non-null required values
      Returns:
      Asset
    • of

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

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