Class PersistenceId$
- java.lang.Object
-
- org.apache.pekko.persistence.typed.PersistenceId$
-
public class PersistenceId$ extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description static PersistenceId$MODULE$Static reference to the singleton instance of this Scala object.
-
Constructor Summary
Constructors Constructor Description PersistenceId$()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PersistenceIdapply(java.lang.String entityTypeHint, java.lang.String entityId)Constructs aPersistenceIdfrom the givenentityTypeHintandentityIdby concatenating them with|separator.PersistenceIdapply(java.lang.String entityTypeHint, java.lang.String entityId, java.lang.String separator)Constructs aPersistenceIdfrom the givenentityTypeHintandentityIdby concatenating them with theseparator.java.lang.StringDefaultSeparator()Default separator character used for concatenating atypeHintwithentityIdto construct unique persistenceId.java.lang.StringextractEntityId(java.lang.String id)Extract theentityIdfrom a persistence id String with the default separator|.java.lang.StringextractEntityType(java.lang.String id)Extract theentityTypeHintfrom a persistence id String with the default separator|.PersistenceIdof(java.lang.String entityTypeHint, java.lang.String entityId)Constructs aPersistenceIdfrom the givenentityTypeHintandentityIdby concatenating them with|separator.PersistenceIdof(java.lang.String entityTypeHint, java.lang.String entityId, java.lang.String separator)Constructs aPersistenceIdfrom the givenentityTypeHintandentityIdby concatenating them with theseparator.PersistenceIdofUniqueId(java.lang.String id)Constructs aPersistenceIdwithidas the full unique identifier.scala.Option<scala.Tuple2<java.lang.String,java.lang.String>>unapply(PersistenceId persistenceId)
-
-
-
Field Detail
-
MODULE$
public static final PersistenceId$ MODULE$
Static reference to the singleton instance of this Scala object.
-
-
Method Detail
-
DefaultSeparator
public java.lang.String DefaultSeparator()
Default separator character used for concatenating atypeHintwithentityIdto construct unique persistenceId.
-
apply
public PersistenceId apply(java.lang.String entityTypeHint, java.lang.String entityId)
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:
java.lang.IllegalArgumentException- if theentityTypeHintorentityIdcontains|
-
apply
public PersistenceId apply(java.lang.String entityTypeHint, java.lang.String entityId, java.lang.String separator)
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:
java.lang.IllegalArgumentException- if theentityTypeHintorentityIdcontainsseparator
-
of
public PersistenceId of(java.lang.String entityTypeHint, java.lang.String entityId)
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:
java.lang.IllegalArgumentException- if theentityTypeHintorentityIdcontains|
-
of
public PersistenceId of(java.lang.String entityTypeHint, java.lang.String entityId, java.lang.String separator)
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:
java.lang.IllegalArgumentException- if theentityTypeHintorentityIdcontainsseparator
-
ofUniqueId
public PersistenceId ofUniqueId(java.lang.String id)
Constructs aPersistenceIdwithidas the full unique identifier.
-
extractEntityType
public java.lang.String extractEntityType(java.lang.String id)
Extract theentityTypeHintfrom a persistence id String with the default separator|. If the separator|is not found it return the empty String ("").
-
extractEntityId
public java.lang.String extractEntityId(java.lang.String id)
Extract theentityIdfrom a persistence id String with the default separator|. If the separator|is not found it return theid.
-
unapply
public scala.Option<scala.Tuple2<java.lang.String,java.lang.String>> unapply(PersistenceId persistenceId)
-
-