Interface TypeImport
- All Superinterfaces:
ImportResource
The data representation for a Type to be imported that is persisted as a Type in the Project.
Example to create an instance using the builder pattern
TypeImport typeImport = TypeImport.builder()
.key("{key}")
.name(nameBuilder -> nameBuilder)
.plusResourceTypeIds(resourceTypeIdsBuilder -> resourceTypeIdsBuilder)
.build()
-
Method Summary
Modifier and TypeMethodDescriptionstatic TypeImportBuilder
builder()
builder factory method for TypeImportstatic TypeImportBuilder
builder
(TypeImport template) create builder for TypeImport instancestatic TypeImport
deepCopy
(TypeImport template) factory method to create a deep copy of TypeImport@Valid LocalizedString
Maps toType.description
.@Valid List<FieldDefinition>
Maps toType.fieldDefinitions
.@NotNull String
getKey()
User-defined unique identifier for the Type.@NotNull @Valid LocalizedString
getName()
Maps toType.name
.@NotNull List<ResourceTypeId>
Maps toType.resourceTypeIds
.static TypeImport
of()
factory methodstatic TypeImport
of
(TypeImport template) factory method to create a shallow copy TypeImportvoid
setDescription
(LocalizedString description) Maps toType.description
.void
setFieldDefinitions
(FieldDefinition... fieldDefinitions) Maps toType.fieldDefinitions
.void
setFieldDefinitions
(List<FieldDefinition> fieldDefinitions) Maps toType.fieldDefinitions
.void
User-defined unique identifier for the Type.void
setName
(LocalizedString name) Maps toType.name
.void
setResourceTypeIds
(ResourceTypeId... resourceTypeIds) Maps toType.resourceTypeIds
.void
setResourceTypeIds
(List<ResourceTypeId> resourceTypeIds) Maps toType.resourceTypeIds
.static com.fasterxml.jackson.core.type.TypeReference<TypeImport>
gives a TypeReference for usage with Jackson DataBinddefault <T> T
withTypeImport
(Function<TypeImport, T> helper) accessor map functionMethods inherited from interface com.commercetools.importapi.models.common.ImportResource
withImportResource
-
Method Details
-
getKey
User-defined unique identifier for the Type. If a Type with this
key
exists, it will be updated with the imported data.- Specified by:
getKey
in interfaceImportResource
- Returns:
- key
-
getName
Maps to
Type.name
.- Returns:
- name
-
getDescription
Maps to
Type.description
.- Returns:
- description
-
getResourceTypeIds
Maps to
Type.resourceTypeIds
. This value cannot be changed after the Type is imported.- Returns:
- resourceTypeIds
-
getFieldDefinitions
Maps to
Type.fieldDefinitions
.- Returns:
- fieldDefinitions
-
setKey
User-defined unique identifier for the Type. If a Type with this
key
exists, it will be updated with the imported data.- Specified by:
setKey
in interfaceImportResource
- Parameters:
key
- value to be set
-
setName
Maps to
Type.name
.- Parameters:
name
- value to be set
-
setDescription
Maps to
Type.description
.- Parameters:
description
- value to be set
-
setResourceTypeIds
Maps to
Type.resourceTypeIds
. This value cannot be changed after the Type is imported.- Parameters:
resourceTypeIds
- values to be set
-
setResourceTypeIds
Maps to
Type.resourceTypeIds
. This value cannot be changed after the Type is imported.- Parameters:
resourceTypeIds
- values to be set
-
setFieldDefinitions
Maps to
Type.fieldDefinitions
.- Parameters:
fieldDefinitions
- values to be set
-
setFieldDefinitions
Maps to
Type.fieldDefinitions
.- Parameters:
fieldDefinitions
- values to be set
-
of
factory method- Returns:
- instance of TypeImport
-
of
factory method to create a shallow copy TypeImport- Parameters:
template
- instance to be copied- Returns:
- copy instance
-
deepCopy
factory method to create a deep copy of TypeImport- Parameters:
template
- instance to be copied- Returns:
- copy instance
-
builder
builder factory method for TypeImport- Returns:
- builder
-
builder
create builder for TypeImport instance- Parameters:
template
- instance with prefilled values for the builder- Returns:
- builder
-
withTypeImport
accessor map function- Type Parameters:
T
- mapped type- Parameters:
helper
- function to map the object- Returns:
- mapped value
-
typeReference
gives a TypeReference for usage with Jackson DataBind- Returns:
- TypeReference
-