Class AssetBuilder
java.lang.Object
com.commercetools.api.models.common.AssetBuilder
AssetBuilder
Example to create an instance using the builder pattern
Example to create an instance using the builder pattern
Asset asset = Asset.builder()
.id("{id}")
.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 Asset with checking for non-null required valuesbuilds Asset without checking for non-null required valuescustom
(CustomFields custom) Custom Fields defined for the Asset.custom
(Function<CustomFieldsBuilder, CustomFieldsBuilder> builder) 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.getId()
Unique identifier of the Asset.getKey()
User-defined identifier of the Asset.getName()
Name of the Asset.value of sources}getTags()
Keywords for categorizing and organizing Assets.Unique identifier of the Asset.User-defined identifier of the Asset.name
(LocalizedString name) Name of the Asset.Name of the Asset.static AssetBuilder
of()
factory method for an instance of AssetBuilderstatic AssetBuilder
create builder for Asset 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.withCustom
(Function<CustomFieldsBuilder, CustomFields> builder) 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
-
AssetBuilder
public AssetBuilder()
-
-
Method Details
-
id
Unique identifier of the Asset.
- Parameters:
id
- value to be set- Returns:
- Builder
-
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
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
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 of the Asset. It is unique per Category or ProductVariant.
- Parameters:
key
- value to be set- Returns:
- Builder
-
getId
Unique identifier of the Asset.
- Returns:
- id
-
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 of the Asset. It is unique per Category or ProductVariant.
- Returns:
- key
-
build
builds Asset with checking for non-null required values -
buildUnchecked
builds Asset without checking for non-null required values- Returns:
- Asset
-
of
factory method for an instance of AssetBuilder- Returns:
- builder
-
of
create builder for Asset instance- Parameters:
template
- instance with prefilled values for the builder- Returns:
- builder
-