Class AssetBuilder

java.lang.Object
com.commercetools.history.models.common.AssetBuilder
All Implemented Interfaces:
Builder<Asset>

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

     Asset asset = Asset.builder()
             .id("{id}")
             .name(nameBuilder -> nameBuilder)
             .description(descriptionBuilder -> descriptionBuilder)
             .custom(customBuilder -> customBuilder)
             .key("{key}")
             .build()
 
  • Constructor Details

    • AssetBuilder

      public AssetBuilder()
  • Method Details

    • id

      public AssetBuilder id(String id)
      set the value to the id
      Parameters:
      id - value to be set
      Returns:
      Builder
    • name

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

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

      public AssetBuilder name(LocalizedString name)
      set the value to the name
      Parameters:
      name - value to be set
      Returns:
      Builder
    • description

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

      public AssetBuilder withDescription(Function<LocalizedStringBuilder,LocalizedString> builder)
      set the value to the description using the builder function
      Parameters:
      builder - function to build the description value
      Returns:
      Builder
    • description

      public AssetBuilder description(LocalizedString description)
      set the value to the description
      Parameters:
      description - value to be set
      Returns:
      Builder
    • custom

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

      public AssetBuilder withCustom(Function<CustomFieldsBuilder,CustomFields> builder)
      set the value to the custom using the builder function
      Parameters:
      builder - function to build the custom value
      Returns:
      Builder
    • custom

      public AssetBuilder custom(CustomFields custom)
      set the value to the custom
      Parameters:
      custom - value to be set
      Returns:
      Builder
    • key

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

      public String getId()
      value of id}
      Returns:
      id
    • getName

      public LocalizedString getName()
      value of name}
      Returns:
      name
    • getDescription

      public LocalizedString getDescription()
      value of description}
      Returns:
      description
    • getCustom

      public CustomFields getCustom()
      value of custom}
      Returns:
      custom
    • getKey

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

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

      public 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