refactor: add sanity checks at adding charging station(s)
[e-mobility-charging-stations-simulator.git] / src / charging-station / ui-server / ui-services / UIServiceFactory.ts
CommitLineData
66a7748d
JB
1import type { AbstractUIService } from './AbstractUIService.js'
2import { UIService001 } from './UIService001.js'
3import { ProtocolVersion } from '../../../types/index.js'
4import type { AbstractUIServer } from '../AbstractUIServer.js'
4198ad5c 5
66a7748d 6// eslint-disable-next-line @typescript-eslint/no-extraneous-class
268a74bb 7export class UIServiceFactory {
66a7748d 8 private constructor () {
4198ad5c
JB
9 // This is intentional
10 }
11
66a7748d 12 public static getUIServiceImplementation (
e7aeea18 13 version: ProtocolVersion,
66a7748d 14 uiServer: AbstractUIServer
551e477c 15 ): AbstractUIService {
4198ad5c
JB
16 switch (version) {
17 case ProtocolVersion['0.0.1']:
66a7748d 18 return new UIService001(uiServer)
4198ad5c
JB
19 }
20 }
21}