// SPDX-License-Identifier: Apache-2.0
import { CheckRegulations, RegulationSubType, RegulationType } from "./RegulationType";
import { InvalidRegulationSubType, InvalidRegulationSubTypeForType } from "./error/InvalidRegulationSubType";
import { InvalidRegulationType } from "./error/InvalidRegulationType";
export class EnvironmentFactory {
    factory;
    environment;
    constructor(factory, environment) {
        this.factory = factory;
        this.environment = environment;
    }
}
export class Factories {
    factories;
    constructor(factories) {
        this.factories = factories;
    }
}
export class Factory {
    static checkRegulationType(value) {
        const errorList = [];
        const length = Object.keys(RegulationType).length;
        if (value >= length)
            errorList.push(new InvalidRegulationType(value));
        return errorList;
    }
    static checkRegulationSubType(value, type) {
        const errorList = [];
        const length = Object.keys(RegulationSubType).length;
        if (value >= length)
            errorList.push(new InvalidRegulationSubType(value));
        if (!CheckRegulations.typeAndSubtype(type, value))
            errorList.push(new InvalidRegulationSubTypeForType(value, type));
        return errorList;
    }
}
