Class CustomObjectDraftBuilder
java.lang.Object
com.commercetools.api.models.custom_object.CustomObjectDraftBuilder
- All Implemented Interfaces:
Builder<CustomObjectDraft>
CustomObjectDraftBuilder
Example to create an instance using the builder pattern
Example to create an instance using the builder pattern
CustomObjectDraft customObjectDraft = CustomObjectDraft.builder()
.container("{container}")
.key("{key}")
.build()
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
builds CustomObjectDraft with checking for non-null required valuesbuilds CustomObjectDraft without checking for non-null required valuesNamespace to group CustomObjects.Namespace to group CustomObjects.getKey()
User-defined unique identifier of the CustomObject within the definedcontainer
.getValue()
Can be any JSON standard type, such as number, string, boolean, array, object, or a common API data type.Current version of the CustomObject.User-defined unique identifier of the CustomObject within the definedcontainer
.static CustomObjectDraftBuilder
of()
factory method for an instance of CustomObjectDraftBuilderstatic CustomObjectDraftBuilder
of
(CustomObjectDraft template) create builder for CustomObjectDraft instanceCan be any JSON standard type, such as number, string, boolean, array, object, or a common API data type.Current version of the CustomObject.
-
Constructor Details
-
CustomObjectDraftBuilder
public CustomObjectDraftBuilder()
-
-
Method Details
-
container
Namespace to group CustomObjects.
- Parameters:
container
- value to be set- Returns:
- Builder
-
key
User-defined unique identifier of the CustomObject within the defined
container
.- Parameters:
key
- value to be set- Returns:
- Builder
-
value
Can be any JSON standard type, such as number, string, boolean, array, object, or a common API data type.
- Fields within
value
that havenull
values are not saved. - For values of type Reference the integrity of the data is not guaranteed. If the referenced object is deleted, the API does not delete the corresponding reference to it and the
value
points to a non-existing object in such case.
- Parameters:
value
- value to be set- Returns:
- Builder
- Fields within
-
version
Current version of the CustomObject.
- Parameters:
version
- value to be set- Returns:
- Builder
-
getContainer
Namespace to group CustomObjects.
- Returns:
- container
-
getKey
User-defined unique identifier of the CustomObject within the defined
container
.- Returns:
- key
-
getValue
Can be any JSON standard type, such as number, string, boolean, array, object, or a common API data type.
- Fields within
value
that havenull
values are not saved. - For values of type Reference the integrity of the data is not guaranteed. If the referenced object is deleted, the API does not delete the corresponding reference to it and the
value
points to a non-existing object in such case.
- Returns:
- value
- Fields within
-
getVersion
Current version of the CustomObject.
- Returns:
- version
-
build
builds CustomObjectDraft with checking for non-null required values- Specified by:
build
in interfaceBuilder<CustomObjectDraft>
- Returns:
- CustomObjectDraft
-
buildUnchecked
builds CustomObjectDraft without checking for non-null required values- Returns:
- CustomObjectDraft
-
of
factory method for an instance of CustomObjectDraftBuilder- Returns:
- builder
-
of
create builder for CustomObjectDraft instance- Parameters:
template
- instance with prefilled values for the builder- Returns:
- builder
-