Class AssetBuilder
Example to create an instance using the builder pattern
Asset asset = Asset.builder()
.key("{key}")
.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 valuesThe representation to be sent to the server when creating a resource with custom fields.custom
(Function<CustomBuilder, CustomBuilder> builder) The representation to be sent to the server when creating a resource with custom fields.description
(LocalizedString 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.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.The representation to be sent to the server when creating a resource with custom fields.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.getKey()
User-defined identifier for the asset.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.value of sources}getTags()
value of tags}User-defined identifier for the asset.name
(LocalizedString 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.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.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 functionadd values to the tagssetSources
(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 sourcesset values to the tagsset value to the tagswithCustom
(Function<CustomBuilder, Custom> builder) The representation to be sent to the server when creating a resource with custom fields.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.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.set the value to the sources using the builder function
-
Constructor Details
-
AssetBuilder
public AssetBuilder()
-
-
Method Details
-
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
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
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
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
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
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
-