Class TypeDraftBuilder
java.lang.Object
com.commercetools.api.models.type.TypeDraftBuilder
TypeDraftBuilder
Example to create an instance using the builder pattern
Example to create an instance using the builder pattern
TypeDraft typeDraft = TypeDraft.builder()
.key("{key}")
.name(nameBuilder -> nameBuilder)
.plusResourceTypeIds(resourceTypeIdsBuilder -> resourceTypeIdsBuilder)
.build()
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionDefines Custom Fields.build()
builds TypeDraft with checking for non-null required valuesbuilds TypeDraft without checking for non-null required valuesdescription
(LocalizedString description) Description of the Type.Description of the Type.fieldDefinitions
(FieldDefinition... fieldDefinitions) Defines Custom Fields.fieldDefinitions
(List<FieldDefinition> fieldDefinitions) Defines Custom Fields.Description of the Type.Defines Custom Fields.getKey()
User-defined unique identifier for the Type.getName()
Name of the Type.Resources and/or data types for which the Type is defined.User-defined unique identifier for the Type.name
(LocalizedString name) Name of the Type.Name of the Type.static TypeDraftBuilder
of()
factory method for an instance of TypeDraftBuilderstatic TypeDraftBuilder
create builder for TypeDraft instanceplusFieldDefinitions
(FieldDefinition... fieldDefinitions) Defines Custom Fields.Defines Custom Fields.plusResourceTypeIds
(ResourceTypeId... resourceTypeIds) Resources and/or data types for which the Type is defined.resourceTypeIds
(ResourceTypeId... resourceTypeIds) Resources and/or data types for which the Type is defined.resourceTypeIds
(List<ResourceTypeId> resourceTypeIds) Resources and/or data types for which the Type is defined.Defines Custom Fields.Description of the Type.Defines Custom Fields.Name of the Type.
-
Constructor Details
-
TypeDraftBuilder
public TypeDraftBuilder()
-
-
Method Details
-
key
User-defined unique identifier for the Type.
- Parameters:
key
- value to be set- Returns:
- Builder
-
name
Name of the Type.
- Parameters:
builder
- function to build the name value- Returns:
- Builder
-
withName
Name of the Type.
- Parameters:
builder
- function to build the name value- Returns:
- Builder
-
name
Name of the Type.
- Parameters:
name
- value to be set- Returns:
- Builder
-
description
public TypeDraftBuilder description(Function<LocalizedStringBuilder, LocalizedStringBuilder> builder) Description of the Type.
- Parameters:
builder
- function to build the description value- Returns:
- Builder
-
withDescription
Description of the Type.
- Parameters:
builder
- function to build the description value- Returns:
- Builder
-
description
Description of the Type.
- Parameters:
description
- value to be set- Returns:
- Builder
-
resourceTypeIds
Resources and/or data types for which the Type is defined.
- Parameters:
resourceTypeIds
- value to be set- Returns:
- Builder
-
resourceTypeIds
Resources and/or data types for which the Type is defined.
- Parameters:
resourceTypeIds
- value to be set- Returns:
- Builder
-
plusResourceTypeIds
Resources and/or data types for which the Type is defined.
- Parameters:
resourceTypeIds
- value to be set- Returns:
- Builder
-
fieldDefinitions
Defines Custom Fields.
- Parameters:
fieldDefinitions
- value to be set- Returns:
- Builder
-
fieldDefinitions
Defines Custom Fields.
- Parameters:
fieldDefinitions
- value to be set- Returns:
- Builder
-
plusFieldDefinitions
Defines Custom Fields.
- Parameters:
fieldDefinitions
- value to be set- Returns:
- Builder
-
plusFieldDefinitions
public TypeDraftBuilder plusFieldDefinitions(Function<FieldDefinitionBuilder, FieldDefinitionBuilder> builder) Defines Custom Fields.
- Parameters:
builder
- function to build the fieldDefinitions value- Returns:
- Builder
-
withFieldDefinitions
public TypeDraftBuilder withFieldDefinitions(Function<FieldDefinitionBuilder, FieldDefinitionBuilder> builder) Defines Custom Fields.
- Parameters:
builder
- function to build the fieldDefinitions value- Returns:
- Builder
-
addFieldDefinitions
public TypeDraftBuilder addFieldDefinitions(Function<FieldDefinitionBuilder, FieldDefinition> builder) Defines Custom Fields.
- Parameters:
builder
- function to build the fieldDefinitions value- Returns:
- Builder
-
setFieldDefinitions
public TypeDraftBuilder setFieldDefinitions(Function<FieldDefinitionBuilder, FieldDefinition> builder) Defines Custom Fields.
- Parameters:
builder
- function to build the fieldDefinitions value- Returns:
- Builder
-
getKey
User-defined unique identifier for the Type.
- Returns:
- key
-
getName
Name of the Type.
- Returns:
- name
-
getDescription
Description of the Type.
- Returns:
- description
-
getResourceTypeIds
Resources and/or data types for which the Type is defined.
- Returns:
- resourceTypeIds
-
getFieldDefinitions
Defines Custom Fields.
- Returns:
- fieldDefinitions
-
build
builds TypeDraft with checking for non-null required values -
buildUnchecked
builds TypeDraft without checking for non-null required values- Returns:
- TypeDraft
-
of
factory method for an instance of TypeDraftBuilder- Returns:
- builder
-
of
create builder for TypeDraft instance- Parameters:
template
- instance with prefilled values for the builder- Returns:
- builder
-