Class AssetSourceBuilder
java.lang.Object
com.commercetools.api.models.common.AssetSourceBuilder
- All Implemented Interfaces:
Builder<AssetSource>
AssetSourceBuilder
Example to create an instance using the builder pattern
Example to create an instance using the builder pattern
AssetSource assetSource = AssetSource.builder()
.uri("{uri}")
.build()
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
builds AssetSource with checking for non-null required valuesbuilds AssetSource without checking for non-null required valuescontentType
(String contentType) Indicates the type of content, for exampleapplication/pdf
.dimensions
(AssetDimensions dimensions) Width and height of the AssetSource.Width and height of the AssetSource.Indicates the type of content, for exampleapplication/pdf
.Width and height of the AssetSource.getKey()
User-defined identifier of the AssetSource.getUri()
URI of the AssetSource.User-defined identifier of the AssetSource.static AssetSourceBuilder
of()
factory method for an instance of AssetSourceBuilderstatic AssetSourceBuilder
of
(AssetSource template) create builder for AssetSource instanceURI of the AssetSource.Width and height of the AssetSource.
-
Constructor Details
-
AssetSourceBuilder
public AssetSourceBuilder()
-
-
Method Details
-
uri
URI of the AssetSource.
- Parameters:
uri
- value to be set- Returns:
- Builder
-
key
User-defined identifier of the AssetSource. Must be unique per Asset.
- Parameters:
key
- value to be set- Returns:
- Builder
-
dimensions
public AssetSourceBuilder dimensions(Function<AssetDimensionsBuilder, AssetDimensionsBuilder> builder) Width and height of the AssetSource.
- Parameters:
builder
- function to build the dimensions value- Returns:
- Builder
-
withDimensions
Width and height of the AssetSource.
- Parameters:
builder
- function to build the dimensions value- Returns:
- Builder
-
dimensions
Width and height of the AssetSource.
- Parameters:
dimensions
- value to be set- Returns:
- Builder
-
contentType
Indicates the type of content, for example
application/pdf
.- Parameters:
contentType
- value to be set- Returns:
- Builder
-
getUri
URI of the AssetSource.
- Returns:
- uri
-
getKey
User-defined identifier of the AssetSource. Must be unique per Asset.
- Returns:
- key
-
getDimensions
Width and height of the AssetSource.
- Returns:
- dimensions
-
getContentType
Indicates the type of content, for example
application/pdf
.- Returns:
- contentType
-
build
builds AssetSource with checking for non-null required values- Specified by:
build
in interfaceBuilder<AssetSource>
- Returns:
- AssetSource
-
buildUnchecked
builds AssetSource without checking for non-null required values- Returns:
- AssetSource
-
of
factory method for an instance of AssetSourceBuilder- Returns:
- builder
-
of
create builder for AssetSource instance- Parameters:
template
- instance with prefilled values for the builder- Returns:
- builder
-