Package io.github.jy95.fds.r5.utils
Class TranslatorsMapR5
java.lang.Object
io.github.jy95.fds.common.types.AbstractTranslatorsMap<FDSConfigR5,org.hl7.fhir.r5.model.Dosage>
io.github.jy95.fds.r5.utils.TranslatorsMapR5
public class TranslatorsMapR5
extends AbstractTranslatorsMap<FDSConfigR5,org.hl7.fhir.r5.model.Dosage>
Map for R5 translators
- Author:
- jy95
-
Field Summary
Fields inherited from class io.github.jy95.fds.common.types.AbstractTranslatorsMap
translationService, translatorCache -
Constructor Summary
ConstructorsConstructorDescriptionTranslatorsMapR5(TranslationService<FDSConfigR5> translationService) Constructor forTranslatorsMapR5. -
Method Summary
Modifier and TypeMethodDescriptionprotected Map<DisplayOrder, Supplier<Translator<org.hl7.fhir.r5.model.Dosage>>> Creates a map ofDisplayOrdertoSupplierinstances that lazily initialize the correspondingTranslatorobjects for the needed configuration.Translator<org.hl7.fhir.r5.model.Dosage> getTranslator(DisplayOrder displayOrder) Retrieves theTranslatorassociated with the specifiedDisplayOrder.
-
Constructor Details
-
TranslatorsMapR5
Constructor forTranslatorsMapR5.- Parameters:
translationService- The translation service used for translation.
-
-
Method Details
-
createTranslatorsSuppliers
protected Map<DisplayOrder,Supplier<Translator<org.hl7.fhir.r5.model.Dosage>>> createTranslatorsSuppliers()Creates a map ofDisplayOrdertoSupplierinstances that lazily initialize the correspondingTranslatorobjects for the needed configuration.This method ensures that translators are only created when needed, improving efficiency and reducing unnecessary resource usage. It supports both simple translators and composite translators that depend on other translators.
- Specified by:
createTranslatorsSuppliersin classAbstractTranslatorsMap<FDSConfigR5,org.hl7.fhir.r5.model.Dosage> - Returns:
- a
Mapwhere the keys areDisplayOrdervalues and the values areSupplierinstances that provideTranslatorobjects
-
getTranslator
Description copied from class:AbstractTranslatorsMapRetrieves theTranslatorassociated with the specifiedDisplayOrder. The translator is created lazily on first access.- Overrides:
getTranslatorin classAbstractTranslatorsMap<FDSConfigR5,org.hl7.fhir.r5.model.Dosage> - Parameters:
displayOrder- theDisplayOrderused to locate the translator- Returns:
- the corresponding
Translator, ornullif no match is found
-