import { MetaElement, IMetaElementJSON } from '../metaElement'; import { IBusinessEventTypeJSON } from './iBusinessEventTypeJSON'; import { IBusinessEventTypeModelFormat } from './iBusinessEventTypeModelFormat'; /** * A `BusinessEventType` is a [[MetaElement]] which represents a type of business events that can be fired. It is used to coordinate the behavior of [[BusinessObjectType]]'s instances. * * BusinessEventTypes are **mutable** */ export class BusinessEventType extends MetaElement { //================================= Constructor ================================== /** * Creates a new business event type bet so that bet.name = name * @param name Name of the business event type */ public constructor(name: string) { super(name); } //================================== Overriding ================================== public toJSON(): IBusinessEventTypeJSON { return { id : this.getId(), name: this.getName() }; } public toModelFormat(): IBusinessEventTypeModelFormat { return { id : this.getId(), name: this.getName() }; } public isValid(): boolean { return this.getName() && this.getName() ! == ""; } };