pyrit.identifiers.Identifiable#
- class Identifiable[source]#
Bases:
ABCAbstract base class for components that provide a behavioral identity.
Components implement
_build_identifier()to return a frozen ComponentIdentifier snapshot. The identifier is built lazily on first access and cached for the component’s lifetime.- __init__()#
Methods
__init__()Get the component's identifier, building it lazily on first access.
- get_identifier() ComponentIdentifier[source]#
Get the component’s identifier, building it lazily on first access.
The identifier is computed once via _build_identifier() and then cached for subsequent calls. This ensures consistent identity throughout the component’s lifetime while deferring computation until actually needed.
Note
Not thread-safe. If thread safety is required, subclasses should implement appropriate synchronization.
- Returns:
- The frozen identity snapshot representing
this component’s behavioral configuration.
- Return type: