Interface Type
- All Superinterfaces:
BaseResource
,DomainResource<Type>
,Identifiable<Type>
,Referencable<Type>
,ResourceIdentifiable<Type>
,TypeMixin
,Versioned<Type>
,WithKey
Example to create an instance using the builder pattern
Type type = Type.builder()
.id("{id}")
.version(0.3)
.createdAt(ZonedDateTime.parse("2022-01-01T12:00:00.301Z"))
.lastModifiedAt(ZonedDateTime.parse("2022-01-01T12:00:00.301Z"))
.key("{key}")
.name(nameBuilder -> nameBuilder)
.plusResourceTypeIds(resourceTypeIdsBuilder -> resourceTypeIdsBuilder)
.plusFieldDefinitions(fieldDefinitionsBuilder -> fieldDefinitionsBuilder)
.build()
-
Method Summary
Modifier and TypeMethodDescriptionstatic TypeBuilder
builder()
builder factory method for Typestatic TypeBuilder
create builder for Type instancestatic Type
factory method to create a deep copy of Type@NotNull ZonedDateTime
Date and time (UTC) the Type was initially created.@Valid CreatedBy
IDs and references that created the Type.@Valid LocalizedString
Description of the Type.@NotNull @Valid List<FieldDefinition>
Defines Custom Fields.@NotNull String
getId()
Unique identifier of the Type.@NotNull String
getKey()
User-defined unique identifier of the Type.@NotNull ZonedDateTime
Date and time (UTC) the Type was last updated.@Valid LastModifiedBy
IDs and references that last modified the Type.@NotNull @Valid LocalizedString
getName()
Name of the Type.@NotNull List<ResourceTypeId>
Resources and/or data types for which the Type is defined.@NotNull Long
Current version of the Type.static Type
of()
factory methodstatic Type
factory method to create a shallow copy Typestatic ReferenceTypeId
void
setCreatedAt
(ZonedDateTime createdAt) Date and time (UTC) the Type was initially created.void
setCreatedBy
(CreatedBy createdBy) IDs and references that created the Type.void
setDescription
(LocalizedString description) Description of the Type.void
setFieldDefinitions
(FieldDefinition... fieldDefinitions) Defines Custom Fields.void
setFieldDefinitions
(List<FieldDefinition> fieldDefinitions) Defines Custom Fields.void
Unique identifier of the Type.void
User-defined unique identifier of the Type.void
setLastModifiedAt
(ZonedDateTime lastModifiedAt) Date and time (UTC) the Type was last updated.void
setLastModifiedBy
(LastModifiedBy lastModifiedBy) IDs and references that last modified the Type.void
setName
(LocalizedString name) Name of the Type.void
setResourceTypeIds
(ResourceTypeId... resourceTypeIds) Resources and/or data types for which the Type is defined.void
setResourceTypeIds
(List<ResourceTypeId> resourceTypeIds) Resources and/or data types for which the Type is defined.void
setVersion
(Long version) Current version of the Type.static com.fasterxml.jackson.core.type.TypeReference<Type>
gives a TypeReference for usage with Jackson DataBinddefault <T> T
accessor map functionMethods inherited from interface com.commercetools.api.models.common.BaseResource
withBaseResource
Methods inherited from interface com.commercetools.api.models.DomainResource
get
Methods inherited from interface com.commercetools.api.models.type.TypeMixin
getFieldDefinitionByName, toReference, toResourceIdentifier
-
Method Details
-
getId
Unique identifier of the Type.
- Specified by:
getId
in interfaceBaseResource
- Specified by:
getId
in interfaceDomainResource<Type>
- Specified by:
getId
in interfaceIdentifiable<Type>
- Specified by:
getId
in interfaceVersioned<Type>
- Returns:
- id
-
getVersion
Current version of the Type.
- Specified by:
getVersion
in interfaceBaseResource
- Specified by:
getVersion
in interfaceDomainResource<Type>
- Specified by:
getVersion
in interfaceVersioned<Type>
- Returns:
- version
-
getCreatedAt
Date and time (UTC) the Type was initially created.
- Specified by:
getCreatedAt
in interfaceBaseResource
- Returns:
- createdAt
-
getLastModifiedAt
Date and time (UTC) the Type was last updated.
- Specified by:
getLastModifiedAt
in interfaceBaseResource
- Returns:
- lastModifiedAt
-
getLastModifiedBy
IDs and references that last modified the Type.
- Returns:
- lastModifiedBy
-
getCreatedBy
IDs and references that created the Type.
- Returns:
- createdBy
-
getKey
User-defined unique identifier of the Type.
-
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.
- Specified by:
getFieldDefinitions
in interfaceTypeMixin
- Returns:
- fieldDefinitions
-
setId
Unique identifier of the Type.
- Specified by:
setId
in interfaceBaseResource
- Parameters:
id
- value to be set
-
setVersion
Current version of the Type.
- Specified by:
setVersion
in interfaceBaseResource
- Parameters:
version
- value to be set
-
setCreatedAt
Date and time (UTC) the Type was initially created.
- Specified by:
setCreatedAt
in interfaceBaseResource
- Parameters:
createdAt
- value to be set
-
setLastModifiedAt
Date and time (UTC) the Type was last updated.
- Specified by:
setLastModifiedAt
in interfaceBaseResource
- Parameters:
lastModifiedAt
- value to be set
-
setLastModifiedBy
IDs and references that last modified the Type.
- Parameters:
lastModifiedBy
- value to be set
-
setCreatedBy
IDs and references that created the Type.
- Parameters:
createdBy
- value to be set
-
setKey
User-defined unique identifier of the Type.
- Parameters:
key
- value to be set
-
setName
Name of the Type.
- Parameters:
name
- value to be set
-
setDescription
Description of the Type.
- Parameters:
description
- value to be set
-
setResourceTypeIds
Resources and/or data types for which the Type is defined.
- Parameters:
resourceTypeIds
- values to be set
-
setResourceTypeIds
Resources and/or data types for which the Type is defined.
- Parameters:
resourceTypeIds
- values to be set
-
setFieldDefinitions
Defines Custom Fields.
- Parameters:
fieldDefinitions
- values to be set
-
setFieldDefinitions
Defines Custom Fields.
- Parameters:
fieldDefinitions
- values to be set
-
of
factory method- Returns:
- instance of Type
-
of
factory method to create a shallow copy Type- Parameters:
template
- instance to be copied- Returns:
- copy instance
-
deepCopy
factory method to create a deep copy of Type- Parameters:
template
- instance to be copied- Returns:
- copy instance
-
builder
builder factory method for Type- Returns:
- builder
-
builder
create builder for Type instance- Parameters:
template
- instance with prefilled values for the builder- Returns:
- builder
-
withType
accessor map function- Type Parameters:
T
- mapped type- Parameters:
helper
- function to map the object- Returns:
- mapped value
-
referenceTypeId
-
typeReference
gives a TypeReference for usage with Jackson DataBind- Returns:
- TypeReference
-