Interface AssetDraft

All Superinterfaces:
CustomizableDraft<AssetDraft>, Draft<AssetDraft>, WithKey

public interface AssetDraft extends CustomizableDraft<AssetDraft>, WithKey, Draft<AssetDraft>
AssetDraft
Example to create an instance using the builder pattern

     AssetDraft assetDraft = AssetDraft.builder()
             .plusSources(sourcesBuilder -> sourcesBuilder)
             .name(nameBuilder -> nameBuilder)
             .build()
 
  • Method Details

    • getSources

      @NotNull @Valid @NotNull @Valid List<AssetSource> getSources()
      Returns:
      sources
    • getName

      @NotNull @Valid @NotNull @Valid LocalizedString getName()

      Name of the Asset.

      Returns:
      name
    • getDescription

      @Valid @Valid LocalizedString getDescription()

      Description of the Asset.

      Returns:
      description
    • getTags

      List<String> getTags()

      Keywords for categorizing and organizing Assets.

      Returns:
      tags
    • getCustom

      @Valid @Valid CustomFieldsDraft getCustom()

      Custom Fields defined for the Asset.

      Specified by:
      getCustom in interface CustomizableDraft<AssetDraft>
      Returns:
      custom
    • getKey

      String getKey()

      User-defined identifier for the Asset. Must be unique per Category or ProductVariant.

      Specified by:
      getKey in interface WithKey
      Returns:
      key
    • setSources

      void setSources(AssetSource... sources)
      set sources
      Parameters:
      sources - values to be set
    • setSources

      void setSources(List<AssetSource> sources)
      set sources
      Parameters:
      sources - values to be set
    • setName

      void setName(LocalizedString name)

      Name of the Asset.

      Parameters:
      name - value to be set
    • setDescription

      void setDescription(LocalizedString description)

      Description of the Asset.

      Parameters:
      description - value to be set
    • setTags

      void setTags(String... tags)

      Keywords for categorizing and organizing Assets.

      Parameters:
      tags - values to be set
    • setTags

      void setTags(List<String> tags)

      Keywords for categorizing and organizing Assets.

      Parameters:
      tags - values to be set
    • setCustom

      void setCustom(CustomFieldsDraft custom)

      Custom Fields defined for the Asset.

      Specified by:
      setCustom in interface CustomizableDraft<AssetDraft>
      Parameters:
      custom - value to be set
    • setKey

      void setKey(String key)

      User-defined identifier for the Asset. Must be unique per Category or ProductVariant.

      Parameters:
      key - value to be set
    • of

      static AssetDraft of()
      factory method
      Returns:
      instance of AssetDraft
    • of

      static AssetDraft of(AssetDraft template)
      factory method to create a shallow copy AssetDraft
      Parameters:
      template - instance to be copied
      Returns:
      copy instance
    • deepCopy

      @Nullable static AssetDraft deepCopy(@Nullable AssetDraft template)
      factory method to create a deep copy of AssetDraft
      Parameters:
      template - instance to be copied
      Returns:
      copy instance
    • builder

      static AssetDraftBuilder builder()
      builder factory method for AssetDraft
      Returns:
      builder
    • builder

      static AssetDraftBuilder builder(AssetDraft template)
      create builder for AssetDraft instance
      Parameters:
      template - instance with prefilled values for the builder
      Returns:
      builder
    • withAssetDraft

      default <T> T withAssetDraft(Function<AssetDraft,T> helper)
      accessor map function
      Type Parameters:
      T - mapped type
      Parameters:
      helper - function to map the object
      Returns:
      mapped value
    • typeReference

      static com.fasterxml.jackson.core.type.TypeReference<AssetDraft> typeReference()
      gives a TypeReference for usage with Jackson DataBind
      Returns:
      TypeReference