Class AssetDraftBuilder
java.lang.Object
com.commercetools.api.models.common.AssetDraftBuilder
- All Implemented Interfaces:
Builder<AssetDraft>
AssetDraftBuilder
Example to create an instance using the builder pattern
Example to create an instance using the builder pattern
AssetDraft assetDraft = AssetDraft.builder()
.plusSources(sourcesBuilder -> sourcesBuilder)
.name(nameBuilder -> nameBuilder)
.build()
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionaddSources
(Function<AssetSourceBuilder, AssetSource> builder) add the value to the sources using the builder functionbuild()
builds AssetDraft with checking for non-null required valuesbuilds AssetDraft without checking for non-null required valuescustom
(CustomFieldsDraft custom) Custom Fields defined for the Asset.Custom Fields defined for the Asset.description
(LocalizedString description) Description of the Asset.Description of the Asset.Custom Fields defined for the Asset.Description of the Asset.getKey()
User-defined identifier for the Asset.getName()
Name of the Asset.value of sources}getTags()
Keywords for categorizing and organizing Assets.User-defined identifier for the Asset.name
(LocalizedString name) Name of the Asset.Name of the Asset.static AssetDraftBuilder
of()
factory method for an instance of AssetDraftBuilderstatic AssetDraftBuilder
of
(AssetDraft template) create builder for AssetDraft instanceplusSources
(AssetSource... sources) add values to the sourcesadd the value to the sources using the builder functionKeywords for categorizing and organizing Assets.setSources
(Function<AssetSourceBuilder, AssetSource> builder) set the value to the sources using the builder functionsources
(AssetSource... sources) set values to the sourcessources
(List<AssetSource> sources) set value to the sourcesKeywords for categorizing and organizing Assets.Keywords for categorizing and organizing Assets.Custom Fields defined for the Asset.Description of the Asset.Name of the Asset.set the value to the sources using the builder function
-
Constructor Details
-
AssetDraftBuilder
public AssetDraftBuilder()
-
-
Method Details
-
sources
set values to the sources- Parameters:
sources
- value to be set- Returns:
- Builder
-
sources
set value to the sources- Parameters:
sources
- value to be set- Returns:
- Builder
-
plusSources
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
Name of the Asset.
- Parameters:
builder
- function to build the name value- Returns:
- Builder
-
withName
Name of the Asset.
- Parameters:
builder
- function to build the name value- Returns:
- Builder
-
name
Name of the Asset.
- Parameters:
name
- value to be set- Returns:
- Builder
-
description
public AssetDraftBuilder description(Function<LocalizedStringBuilder, LocalizedStringBuilder> builder) Description of the Asset.
- Parameters:
builder
- function to build the description value- Returns:
- Builder
-
withDescription
Description of the Asset.
- Parameters:
builder
- function to build the description value- Returns:
- Builder
-
description
Description of the Asset.
- Parameters:
description
- value to be set- Returns:
- Builder
-
tags
Keywords for categorizing and organizing Assets.
- Parameters:
tags
- value to be set- Returns:
- Builder
-
tags
Keywords for categorizing and organizing Assets.
- Parameters:
tags
- value to be set- Returns:
- Builder
-
plusTags
Keywords for categorizing and organizing Assets.
- Parameters:
tags
- value to be set- Returns:
- Builder
-
custom
public AssetDraftBuilder custom(Function<CustomFieldsDraftBuilder, CustomFieldsDraftBuilder> builder) Custom Fields defined for the Asset.
- Parameters:
builder
- function to build the custom value- Returns:
- Builder
-
withCustom
Custom Fields defined for the Asset.
- Parameters:
builder
- function to build the custom value- Returns:
- Builder
-
custom
Custom Fields defined for the Asset.
- Parameters:
custom
- value to be set- Returns:
- Builder
-
key
User-defined identifier for the Asset. Must be unique per Category or ProductVariant.
- Parameters:
key
- value to be set- Returns:
- Builder
-
getSources
value of sources}- Returns:
- sources
-
getName
Name of the Asset.
- Returns:
- name
-
getDescription
Description of the Asset.
- Returns:
- description
-
getTags
Keywords for categorizing and organizing Assets.
- Returns:
- tags
-
getCustom
Custom Fields defined for the Asset.
- Returns:
- custom
-
getKey
User-defined identifier for the Asset. Must be unique per Category or ProductVariant.
- Returns:
- key
-
build
builds AssetDraft with checking for non-null required values- Specified by:
build
in interfaceBuilder<AssetDraft>
- Returns:
- AssetDraft
-
buildUnchecked
builds AssetDraft without checking for non-null required values- Returns:
- AssetDraft
-
of
factory method for an instance of AssetDraftBuilder- Returns:
- builder
-
of
create builder for AssetDraft instance- Parameters:
template
- instance with prefilled values for the builder- Returns:
- builder
-