Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Onno Haldar
committed
Sep 25, 2017
1 parent
2acf5ca
commit e73b444
Showing
6 changed files
with
28 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// ZGWNU Ng Bonita Module Imports | ||
import { ZgwnuBonitaBusinessDataObjectInterface } from './zgwnu-bonita-business-data-object.interface' | ||
import { ZgwnuBonitaBusinessDataObjectListInterface } from './zgwnu-bonita-business-data-object-list.interface' | ||
|
||
export function ZgwnuBonitaMapBusinessObject<T extends ZgwnuBonitaBusinessDataObjectInterface>(dataObject: Object, businessDataObject: T): void { | ||
for (let dataObjectKey in dataObject) { | ||
console.log('dataObjectKey', dataObjectKey) | ||
let dataObjectType: string = typeof dataObjectKey | ||
console.log('dataObjectType', dataObjectType) | ||
switch(dataObjectType) { | ||
// direct mapping object to object | ||
case 'string' || 'number' || 'boolean': | ||
businessDataObject[dataObjectKey] = dataObject[dataObjectKey] | ||
break | ||
// indirect mapping of custom objects (that need a specific constructor) | ||
case 'object': | ||
businessDataObject.mapObject(dataObjectKey, dataObject[dataObjectKey]) | ||
break | ||
default: | ||
console.log('dataProperty not mapped = ', dataObject[dataObjectKey]) | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters