@jaricardodev/ews-javascript-api
Version:
EWS Managed api in JavaScript
25 lines (24 loc) • 1.13 kB
text/typescript
import {DictionaryKeyType} from "../Enumerations/DictionaryKeyType";
import {IOutParam} from "../Interfaces/IOutParam";
import {PhysicalAddressEntry} from "./PhysicalAddressEntry";
import {PhysicalAddressKey} from "../Enumerations/PhysicalAddressKey";
import {DictionaryProperty} from "./DictionaryProperty";
export class PhysicalAddressDictionary extends DictionaryProperty<PhysicalAddressKey, PhysicalAddressEntry> {
constructor() {
super(DictionaryKeyType.PhysicalAddressKey);
}
_getItem(key: PhysicalAddressKey): PhysicalAddressEntry {
return this.Entries.get(key);
}
_setItem(key: PhysicalAddressKey, value: PhysicalAddressEntry) {
if (value == null) {
this.InternalRemove(key);
}
else {
value.Key = key;
this.InternalAddOrReplace(value);
}
}
CreateEntryInstance(): PhysicalAddressEntry { return new PhysicalAddressEntry(); }
TryGetValue(key: PhysicalAddressKey, physicalAddress: IOutParam<PhysicalAddressEntry>): boolean { return this.Entries.tryGetValue(key, physicalAddress); }
}