import { ParameterType } from "../utils/constants" ; import { Parameter } from "./Parameter" ; export class BuildConfig { private queueAtTop : boolean = false ; private parameters : Parameter [ ] [ ] = [ ] ; constructor ( public readonly id , public readonly externalId , public readonly name ) { } public invertQueueAtTop ( ) { this . queueAtTop = ! this . queueAtTop ; } public shouldQueueAtTop ( ) { return this . queueAtTop ; } public getConfigParameters ( ) { return this . getParameter ( ParameterType . ConfigParameter ) ; } public getSystemProperties ( ) { return this . getParameter ( ParameterType . SystemProperty ) ; } public getEnvVariables ( ) { return this . getParameter ( ParameterType . EnvVariable ) ; } public addParameter ( paramType , param ) { if ( ! this . parameters [ paramType ] ) { this . parameters [ paramType ] = [ ] ; } this . parameters [ paramType ] . push ( param ) ; } public removeParameter ( paramType , param ) { if ( ! this . parameters [ paramType ] ) { return ; } const index = this . parameters [ paramType ] . indexOf ( param ) ; if ( index > - 1 ) { this . parameters [ paramType ] . splice ( index , 1 ) ; } } private getParameter ( paramType ) { if ( ! this . parameters [ paramType ] ) { return [ ] ; } return this . parameters [ paramType ] ; } public resetCustomization ( ) { this . queueAtTop = false ; this . parameters = [ ] ; } }