Interface TypeAddFieldDefinitionAction
- All Superinterfaces:
ResourceUpdateAction<TypeUpdateAction>
,TypeUpdateAction
Defines a new field for a Type. Adding new required fields to a Type that is already referenced by existing entities can put those entities in a temporarily inconsistent state.
If a Type that is already in use requires new fields, we recommend making them optional (required
set to false
) whenever possible. Alternatively, any new required fields should be added one at a time followed by an update to all the resources using the Type. This prevents validation errors caused by an entity missing more than one required custom field.
Example to create an instance using the builder pattern
TypeAddFieldDefinitionAction typeAddFieldDefinitionAction = TypeAddFieldDefinitionAction.builder()
.fieldDefinition(fieldDefinitionBuilder -> fieldDefinitionBuilder)
.build()
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
discriminator value for TypeAddFieldDefinitionAction -
Method Summary
Modifier and TypeMethodDescriptionbuilder()
builder factory method for TypeAddFieldDefinitionActionbuilder
(TypeAddFieldDefinitionAction template) create builder for TypeAddFieldDefinitionAction instancestatic TypeAddFieldDefinitionAction
deepCopy
(TypeAddFieldDefinitionAction template) factory method to create a deep copy of TypeAddFieldDefinitionAction@NotNull @Valid FieldDefinition
Value to append to the array.static TypeAddFieldDefinitionAction
of()
factory methodstatic TypeAddFieldDefinitionAction
of
(TypeAddFieldDefinitionAction template) factory method to create a shallow copy TypeAddFieldDefinitionActionvoid
setFieldDefinition
(FieldDefinition fieldDefinition) Value to append to the array.static com.fasterxml.jackson.core.type.TypeReference<TypeAddFieldDefinitionAction>
gives a TypeReference for usage with Jackson DataBinddefault <T> T
accessor map functionMethods inherited from interface com.commercetools.api.models.ResourceUpdateAction
get
Methods inherited from interface com.commercetools.api.models.type.TypeUpdateAction
getAction, withTypeUpdateAction
-
Field Details
-
ADD_FIELD_DEFINITION
discriminator value for TypeAddFieldDefinitionAction- See Also:
-
-
Method Details
-
getFieldDefinition
Value to append to the array.
- Returns:
- fieldDefinition
-
setFieldDefinition
Value to append to the array.
- Parameters:
fieldDefinition
- value to be set
-
of
factory method- Returns:
- instance of TypeAddFieldDefinitionAction
-
of
factory method to create a shallow copy TypeAddFieldDefinitionAction- Parameters:
template
- instance to be copied- Returns:
- copy instance
-
deepCopy
@Nullable static TypeAddFieldDefinitionAction deepCopy(@Nullable TypeAddFieldDefinitionAction template) factory method to create a deep copy of TypeAddFieldDefinitionAction- Parameters:
template
- instance to be copied- Returns:
- copy instance
-
builder
builder factory method for TypeAddFieldDefinitionAction- Returns:
- builder
-
builder
create builder for TypeAddFieldDefinitionAction instance- Parameters:
template
- instance with prefilled values for the builder- Returns:
- builder
-
withTypeAddFieldDefinitionAction
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
-