/**
  * Helper class for lazy initialized values. Ensures the value is only generated once, and remain immutable
  */ export class Lazy < T > { private _value : T | undefined ; private _evaluated : boolean = false ; param valueGenerator constructor ( private readonly valueGenerator ) { } /**
     * Return true if the value as been generated, otherwise false
     */ public get evaluated ( ) : boolean { return this . _evaluated ; } /**
     * Get the value. If this is the first call the value will be generated
     */ public get value ( ) : T { if ( ! this . _evaluated ) { this . _evaluated = true ; this . _value = this . valueGenerator ( ) ; } return this . _value ! ; } }