All Downloads are FREE. Search and download functionalities are using the official Maven repository.

src.app.core.model.scenario.strategy-definition.model.ts Maven / Gradle / Ivy

There is a newer version: 3.0.0
Show newest version
import { areEquals, Equals } from '@shared/equals';
import { cloneAsPossible, Clonable } from '@shared/clonable';
import { ParameterDefinition } from '@core/model/scenario/strategy-parameter-definition.model';

export class StrategyDefinition implements Equals, Clonable {

    constructor(
        public type: string,
        public parameters: ParameterDefinition[],
        public isDefault: boolean
    ) {
    }

    public equals(obj: StrategyDefinition): boolean {
        return obj
            && areEquals(this.type, obj.type)
            && areEquals(this.parameters, obj.parameters)
            && areEquals(this.isDefault, obj.isDefault);
    }

    public clone(): StrategyDefinition {
        return new StrategyDefinition(
            cloneAsPossible(this.type),
            cloneAsPossible(this.parameters),
            cloneAsPossible(this.isDefault)
        );
    }
}






© 2015 - 2025 Weber Informatics LLC | Privacy Policy