Class PersistenceId$
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final PersistenceId$Static reference to the singleton instance of this Scala object. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionConstructs aPersistenceIdfrom the givenentityTypeHintandentityIdby concatenating them with|separator.Constructs aPersistenceIdfrom the givenentityTypeHintandentityIdby concatenating them with theseparator.Default separator character used for concatenating atypeHintwithentityIdto construct unique persistenceId.Extract theentityIdfrom a persistence id String with the default separator|.Extract theentityTypeHintfrom a persistence id String with the default separator|.Constructs aPersistenceIdfrom the givenentityTypeHintandentityIdby concatenating them with|separator.Constructs aPersistenceIdfrom the givenentityTypeHintandentityIdby concatenating them with theseparator.ofUniqueId(String id) Constructs aPersistenceIdwithidas the full unique identifier.unapply(PersistenceId persistenceId)
-
Field Details
-
MODULE$
Static reference to the singleton instance of this Scala object.
-
-
Constructor Details
-
PersistenceId$
public PersistenceId$()
-
-
Method Details
-
DefaultSeparator
Default separator character used for concatenating atypeHintwithentityIdto construct unique persistenceId. -
apply
Constructs aPersistenceIdfrom the givenentityTypeHintandentityIdby concatenating them with|separator.Cluster Sharding is often used together with
EventSourcedBehaviorfor the entities. ThePersistenceIdof theEventSourcedBehaviorcan typically be constructed with:PersistenceId(entityContext.entityTypeKey.name, entityContext.entityId)That format of the
PersistenceIdis not mandatory and only provided as a convenience of a "standardized" format.Another separator can be defined by using the
applythat takes aseparatorparameter.- Throws:
IllegalArgumentException- if theentityTypeHintorentityIdcontains|
-
apply
Constructs aPersistenceIdfrom the givenentityTypeHintandentityIdby concatenating them with theseparator.Cluster Sharding is often used together with
EventSourcedBehaviorfor the entities. ThePersistenceIdof theEventSourcedBehaviorcan typically be constructed with:PersistenceId(entityContext.entityTypeKey.name, entityContext.entityId)That format of the
PersistenceIdis not mandatory and only provided as a convenience of a "standardized" format.The default separator
|is used by theapplythat doesn't take aseparatorparameter.- Throws:
IllegalArgumentException- if theentityTypeHintorentityIdcontainsseparator
-
of
Constructs aPersistenceIdfrom the givenentityTypeHintandentityIdby concatenating them with|separator.Cluster Sharding is often used together with
EventSourcedBehaviorfor the entities. ThePersistenceIdof theEventSourcedBehaviorcan typically be constructed with:PersistenceId.of(entityContext.getEntityTypeKey().name(), entityContext.getEntityId())That format of the
PersistenceIdis not mandatory and only provided as a convenience of a "standardized" format.Another separator can be defined by using the
PersistenceId.ofthat takes aseparatorparameter.- Throws:
IllegalArgumentException- if theentityTypeHintorentityIdcontains|
-
of
Constructs aPersistenceIdfrom the givenentityTypeHintandentityIdby concatenating them with theseparator.Cluster Sharding is often used together with
EventSourcedBehaviorfor the entities. ThePersistenceIdof theEventSourcedBehaviorcan typically be constructed with:PersistenceId.of(entityContext.getEntityTypeKey().name(), entityContext.getEntityId())That format of the
PersistenceIdis not mandatory and only provided as a convenience of a "standardized" format.The default separator
|is used by theapplythat doesn't take aseparatorparameter.- Throws:
IllegalArgumentException- if theentityTypeHintorentityIdcontainsseparator
-
ofUniqueId
Constructs aPersistenceIdwithidas the full unique identifier. -
extractEntityType
Extract theentityTypeHintfrom a persistence id String with the default separator|. If the separator|is not found it return the empty String (""). -
extractEntityId
Extract theentityIdfrom a persistence id String with the default separator|. If the separator|is not found it return theid. -
unapply
-