Works out the tags of an event type and the aliases left behind by renamed cases. It reads the current tags from Schema[E], and the old ones from the RenameCase actions of an optional Migration[E, E].
Without a migration there are no aliases. With one, each renamed case becomes an alias, so old events can still be read and queried. The names are used exactly as written in the migration.
val migration: Migration[UserEvent, UserEvent] =
Migration.newBuilder[UserEvent, UserEvent]
.renameCase("UserCreated", "UserRegistered")
.build
val info = TagResolver.resolve[UserEvent](migration)
// info.aliases == Map("UserCreated" -> "UserRegistered")
The event stores call these functions when they are created, so applications normally only pass a migration and do not call them directly.
Attributes
- Companion
- trait
- Source
- TagResolver.scala
- Graph
-
- Supertypes
- Self type
-
TagResolver.type
Members list
Value members
Concrete methods
The old-to-current aliases of a migration, with chains of renames followed: if A was renamed to B and B to C, then A maps to C. A cycle of renames stops instead of looping.
The old-to-current aliases of a migration, with chains of renames followed: if A was renamed to B and B to C, then A maps to C. A cycle of renames stops instead of looping.
Attributes
- Source
- TagResolver.scala
Reads the RenameCase actions of a migration into a map from the old name to the new one. Other actions are ignored. If one old name is renamed more than once, the last rename wins. Chains are not followed here, see aliasMap.
Reads the RenameCase actions of a migration into a map from the old name to the new one. Other actions are ignored. If one old name is renamed more than once, the last rename wins. Chains are not followed here, see aliasMap.
Attributes
- Source
- TagResolver.scala
The old-to-current tag aliases of the given migration. Pass null for no migration, which is the default.
The old-to-current tag aliases of the given migration. Pass null for no migration, which is the default.
Attributes
- Source
- TagResolver.scala
All tags of E, current and old. Pass null for no migration, which is the default.
All tags of E, current and old. Pass null for no migration, which is the default.
Attributes
- Source
- TagResolver.scala
The tags that events of type E are stored under now.
The tags that events of type E are stored under now.
For a sealed event type there is one tag per case: the number from its @eventTag, or the case name if it has none. For a single, non-sealed type the tag is its @eventTag number or its type name, and there is none if the name is empty, Object or Any.
Attributes
- Source
- TagResolver.scala
Builds a TagInfo with the aliases of the given migration.
Builds a TagInfo with no aliases, for an event type never renamed.
Builds a TagInfo with no aliases, for an event type never renamed.
Attributes
- Source
- TagResolver.scala
Builds a TagInfo, using a Migration[E, E] if a given instance is available and none otherwise. It is Scala 3 only, and resolves the instance at the call site.
Builds a TagInfo, using a Migration[E, E] if a given instance is available and none otherwise. It is Scala 3 only, and resolves the instance at the call site.
Attributes
- Source
- TagResolver.scala
Builds a TagInfo, using a Migration[E, E] if one is in implicit scope and none otherwise. This form also works in Scala 2.
Builds a TagInfo, using a Migration[E, E] if one is in implicit scope and none otherwise. This form also works in Scala 2.
Attributes
- Source
- TagResolver.scala
Builds a TagInfo from Schema[E] and an optional migration. This is the function the others call.
Builds a TagInfo from Schema[E] and an optional migration. This is the function the others call.
Chains of renames are followed, so if A was renamed to B and B to C, then A maps to C.
Attributes
- Source
- TagResolver.scala
The tags found in the store that tagInfo does not know about. The same as TagInfo.unknownTags.
The tags found in the store that tagInfo does not know about. The same as TagInfo.unknownTags.
Attributes
- Source
- TagResolver.scala