Class ImageBuilder
java.lang.Object
com.commercetools.api.models.common.ImageBuilder
ImageBuilder
Example to create an instance using the builder pattern
Example to create an instance using the builder pattern
Image image = Image.builder()
.url("{url}")
.dimensions(dimensionsBuilder -> dimensionsBuilder)
.build()
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
builds Image with checking for non-null required valuesbuilds Image without checking for non-null required valuesdimensions
(ImageDimensions dimensions) Dimensions of the original image.Dimensions of the original image.Dimensions of the original image.getLabel()
Custom label for the image.getUrl()
URL of the image in its original size that must be unique within a single ProductVariant.Custom label for the image.static ImageBuilder
of()
factory method for an instance of ImageBuilderstatic ImageBuilder
create builder for Image instanceURL of the image in its original size that must be unique within a single ProductVariant.Dimensions of the original image.
-
Constructor Details
-
ImageBuilder
public ImageBuilder()
-
-
Method Details
-
url
URL of the image in its original size that must be unique within a single ProductVariant.
- Parameters:
url
- value to be set- Returns:
- Builder
-
dimensions
Dimensions of the original image.
- Parameters:
builder
- function to build the dimensions value- Returns:
- Builder
-
withDimensions
Dimensions of the original image.
- Parameters:
builder
- function to build the dimensions value- Returns:
- Builder
-
dimensions
Dimensions of the original image.
- Parameters:
dimensions
- value to be set- Returns:
- Builder
-
label
Custom label for the image.
- Parameters:
label
- value to be set- Returns:
- Builder
-
getUrl
URL of the image in its original size that must be unique within a single ProductVariant.
- Returns:
- url
-
getDimensions
Dimensions of the original image.
- Returns:
- dimensions
-
getLabel
Custom label for the image.
- Returns:
- label
-
build
builds Image with checking for non-null required values -
buildUnchecked
builds Image without checking for non-null required values- Returns:
- Image
-
of
factory method for an instance of ImageBuilder- Returns:
- builder
-
of
create builder for Image instance- Parameters:
template
- instance with prefilled values for the builder- Returns:
- builder
-