Registry for mandate serialization strategies
new
MandateSerializationStrategyRegistry(typeDetector?: MandateTypeDetectorRegistry)
private
readonly
strategies: Map<MandateType, MandateSerializationStrategy>
private
readonly
typeDetector: MandateTypeDetectorRegistry
deserializeMandate(json: string): Promise<Mandate>
Deserialize mandate by detecting type from JSON and using appropriate strategy
getStrategy(mandateType: MandateType): MandateSerializationStrategy | undefined
Get strategy for a specific mandate type
registerStrategy(strategy: MandateSerializationStrategy): void
Register a serialization strategy
serializeMandate(mandate: Mandate): Promise<string>
Serialize mandate by detecting type and using appropriate strategy
deserialize(json: string): Promise<Mandate>
Static method to deserialize a mandate using the default registry