src/models/events/odm/domain-management-object-removed-event.ts
Serializable REDHAWK Domain Object Removed Event
Properties |
|
Methods |
deserialize | ||||||||
deserialize(input: any)
|
||||||||
Deserializes a JSON object into this class
Parameters :
Returns :
this
|
Public sourceCategory |
sourceCategory:
|
Type : SourceCategory
|
Category of this event (i.e., the type of REDHAWK entity producing it) |
import { ISerializable } from '../../serialization/index';
import { SourceCategory } from './enums/index';
import { DomainManagementObjectEvent } from './domain-management-object-event';
/**
* Serializable REDHAWK Domain Object Removed Event
*/
export class DomainManagementObjectRemovedEvent
extends DomainManagementObjectEvent
implements ISerializable<DomainManagementObjectRemovedEvent> {
/** Category of this event (i.e., the type of REDHAWK entity producing it) */
public sourceCategory: SourceCategory;
/** Deserializes a JSON object into this class */
deserialize(input: any) {
super.deserialize(input);
this.sourceCategory = fromString(input.sourceCategory.value);
return this;
}
}
function fromString (category: string): SourceCategory {
let out = SourceCategory.UNKNOWN;
switch (category) {
case 'DEVICE_MANAGER':
out = SourceCategory.DEVICE_MANAGER;
break;
case 'DEVICE':
out = SourceCategory.DEVICE;
break;
case 'APPLICATION_FACTORY':
out = SourceCategory.APPLICATION_FACTORY;
break;
case 'APPLICATION':
out = SourceCategory.APPLICATION;
break;
case 'SERVICE':
out = SourceCategory.SERVICE;
break;
default:
// Do anything?
break;
}
return out;
}