Guid
Type parameters
▪ T: SuperConstructor
▪ T: SuperConstructor
Hierarchy
ValueObject
↳ Guid
Implements
- Definable
 - Hookable
 - Ejsonable
 - Stringifiable
 - Definable
 - Hookable
 - Ejsonable
 - Stringifiable
 
Index
Constructors
Properties
Methods
- equals
 - getActions
 - getHook
 - getHookOrThrow
 - getHooks
 - getLegacyTransformer
 - getLegacyTransformers
 - getPropTypes
 - getPropertyInitializers
 - getSchemaVersion
 - getTypeName
 - hasAction
 - hasHook
 - hasLegacyTransformer
 - in
 - overrideHook
 - overrideLegacyTransformer
 - processSerializableList
 - registerHook
 - registerLegacyTransformer
 - removeHook
 - toJSONValue
 - toPlainObject
 - toString
 - transformLegacyProps
 - typeName
 - validateProps
 - valueOf
 - disableSerializableLists
 - enableSerializableLists
 - from
 - generate
 - getPropTypes
 - getPropertyInitializers
 - getTypeName
 - isValid
 - toString
 - typeName
 
Constructors
constructor
+ new Guid(propsOrVal?: object | string): Guid
Overrides Serializable.constructor
Creates an instance Guid. Creates an instance Guid.
throws {InvalidGuidValueError}
Thrown if provided id is not a string or is not matching valid uuid v4 pattern.
throws {InvalidGuidValueError}
Thrown if provided id is not a string or is not matching valid uuid v4 pattern.
Parameters:
| Name | Type | Description | 
|---|---|---|
propsOrVal? | object | string | Guid value as a string or object containing property id as a string. | 
Returns: Guid
Properties
id
• id: string
Optional schemaVersion
• schemaVersion? : number
Inherited from Serializable.schemaVersion
Overrides VersionableMixin.schemaVersion
Static pattern
▪ pattern: RegExp‹› = /^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i
Methods
equals
▸ equals(otherGuid: Guid): boolean
Overrides DefinableMixin.equals
Evaluates if guid is equal to other by comparing their values.
Parameters:
| Name | Type | Description | 
|---|---|---|
otherGuid | Guid | Other instance of Guid. | 
Returns: boolean
Returns true if both guid values are equal, else false.
getActions
▸ getActions(): Actions
Implementation of Hookable
Inherited from HookableMixin.getActions
Overrides CreateEmployee.getActions
Returns: Actions
getHook
▸ getHook(action: string, id: string): Hook | undefined
Implementation of Hookable
Inherited from HookableMixin.getHook
Overrides CreateEmployee.getHook
Parameters:
| Name | Type | 
|---|---|
action | string | 
id | string | 
Returns: Hook | undefined
getHookOrThrow
▸ getHookOrThrow(action: string, id: string): Hook
Implementation of Hookable
Inherited from HookableMixin.getHookOrThrow
Overrides CreateEmployee.getHookOrThrow
Parameters:
| Name | Type | 
|---|---|
action | string | 
id | string | 
Returns: Hook
getHooks
▸ getHooks(action: string): Mappings
Implementation of Hookable
Inherited from HookableMixin.getHooks
Overrides CreateEmployee.getHooks
Parameters:
| Name | Type | 
|---|---|
action | string | 
Returns: Mappings
getLegacyTransformer
▸ getLegacyTransformer(schemaVersion: number): Hook
Implementation of Ejsonable
Inherited from VersionableMixin.getLegacyTransformer
Overrides CreateEmployee.getLegacyTransformer
Parameters:
| Name | Type | 
|---|---|
schemaVersion | number | 
Returns: Hook
getLegacyTransformers
▸ getLegacyTransformers(): LegacyTransformers
Implementation of Ejsonable
Inherited from VersionableMixin.getLegacyTransformers
Overrides CreateEmployee.getLegacyTransformers
Returns: LegacyTransformers
getPropTypes
▸ getPropTypes(): Props
Implementation of Ejsonable
Inherited from DefinableMixin.getPropTypes
Overrides CreateEmployee.getPropTypes
Returns: Props
getPropertyInitializers
▸ getPropertyInitializers(): Props
Implementation of Ejsonable
Inherited from DefinableMixin.getPropertyInitializers
Overrides CreateEmployee.getPropertyInitializers
Returns: Props
getSchemaVersion
▸ getSchemaVersion(): number | undefined
Implementation of Ejsonable
Inherited from VersionableMixin.getSchemaVersion
Overrides CreateEmployee.getSchemaVersion
Returns: number | undefined
getTypeName
▸ getTypeName(): TypeName
Implementation of Ejsonable
Inherited from SerializableMixin.getTypeName
Overrides CreateEmployee.getTypeName
Returns: TypeName
hasAction
▸ hasAction(action: string): boolean
Implementation of Hookable
Inherited from HookableMixin.hasAction
Overrides CreateEmployee.hasAction
Parameters:
| Name | Type | 
|---|---|
action | string | 
Returns: boolean
hasHook
▸ hasHook(action: string, id: string): boolean
Implementation of Hookable
Inherited from HookableMixin.hasHook
Overrides CreateEmployee.hasHook
Parameters:
| Name | Type | 
|---|---|
action | string | 
id | string | 
Returns: boolean
hasLegacyTransformer
▸ hasLegacyTransformer(schemaVersion: number): boolean
Implementation of Ejsonable
Inherited from VersionableMixin.hasLegacyTransformer
Overrides CreateEmployee.hasLegacyTransformer
Parameters:
| Name | Type | 
|---|---|
schemaVersion | number | 
Returns: boolean
in
▸ in‹T›(listName: string): List‹T›
Inherited from Serializable.in
Overrides CreateEmployee.in
Type parameters:
▪ T
Parameters:
| Name | Type | 
|---|---|
listName | string | 
Returns: List‹T›
overrideHook
▸ overrideHook(action: string, id: string, hook: Hook): void
Implementation of Hookable
Inherited from HookableMixin.overrideHook
Overrides CreateEmployee.overrideHook
Parameters:
| Name | Type | 
|---|---|
action | string | 
id | string | 
hook | Hook | 
Returns: void
overrideLegacyTransformer
▸ overrideLegacyTransformer(schemaVersion: number, transformer: Hook): void
Implementation of Ejsonable
Inherited from VersionableMixin.overrideLegacyTransformer
Overrides CreateEmployee.overrideLegacyTransformer
Parameters:
| Name | Type | 
|---|---|
schemaVersion | number | 
transformer | Hook | 
Returns: void
processSerializableList
▸ processSerializableList(props?: Props): Props
Inherited from Serializable.processSerializableList
Overrides CreateEmployee.processSerializableList
Parameters:
| Name | Type | 
|---|---|
props? | Props | 
Returns: Props
registerHook
▸ registerHook(action: string, id: string, hook: Hook, shouldOverride?: boolean): void
Implementation of Hookable
Inherited from HookableMixin.registerHook
Overrides CreateEmployee.registerHook
Parameters:
| Name | Type | 
|---|---|
action | string | 
id | string | 
hook | Hook | 
shouldOverride? | boolean | 
Returns: void
registerLegacyTransformer
▸ registerLegacyTransformer(schemaVersion: number, transformer: Hook, shouldOverride?: boolean): void
Implementation of Ejsonable
Inherited from VersionableMixin.registerLegacyTransformer
Overrides CreateEmployee.registerLegacyTransformer
Parameters:
| Name | Type | 
|---|---|
schemaVersion | number | 
transformer | Hook | 
shouldOverride? | boolean | 
Returns: void
removeHook
▸ removeHook(action: string, id: string): void
Implementation of Hookable
Inherited from HookableMixin.removeHook
Overrides CreateEmployee.removeHook
Parameters:
| Name | Type | 
|---|---|
action | string | 
id | string | 
Returns: void
toJSONValue
▸ toJSONValue(): Record‹string, any›
Implementation of Ejsonable
Inherited from SerializableMixin.toJSONValue
Overrides CreateEmployee.toJSONValue
Returns: Record‹string, any›
toPlainObject
▸ toPlainObject(): Props
Implementation of Ejsonable
Inherited from DefinableMixin.toPlainObject
Overrides CreateEmployee.toPlainObject
Returns: Props
toString
▸ toString(): string
Implementation of Stringifiable
Overrides SerializableMixin.toString
Converts Guid to string.
Returns: string
Guid converted as a string.
transformLegacyProps
▸ transformLegacyProps(props: Props): Props
Implementation of Ejsonable
Inherited from VersionableMixin.transformLegacyProps
Overrides CreateEmployee.transformLegacyProps
Parameters:
| Name | Type | 
|---|---|
props | Props | 
Returns: Props
typeName
▸ typeName(): TypeName
Implementation of Ejsonable
Inherited from EjsonableMixin.typeName
Overrides CreateEmployee.typeName
Returns: TypeName
validateProps
▸ validateProps(props: Record‹string | number | symbol, any› | undefined, propTypes: PropTypes, isStrict?: boolean): boolean
Inherited from DefinableMixin.validateProps
Overrides CreateEmployee.validateProps
Parameters:
| Name | Type | 
|---|---|
props | Record‹string | number | symbol, any› | undefined | 
propTypes | PropTypes | 
isStrict? | boolean | 
Returns: boolean
valueOf
▸ valueOf(): string
Returns id value.
Returns: string
Value of the guid as id.
Static disableSerializableLists
▸ disableSerializableLists(): void
Inherited from Serializable.disableSerializableLists
Overrides CreateEmployee.disableSerializableLists
Returns: void
Static enableSerializableLists
▸ enableSerializableLists(): void
Inherited from Serializable.enableSerializableLists
Overrides CreateEmployee.enableSerializableLists
Returns: void
Static from
▸ from(...sources: Record‹string, any›[]): any
Inherited from Serializable.from
Overrides CreateEmployee.from
Parameters:
| Name | Type | 
|---|---|
...sources | Record‹string, any›[] | 
Returns: any
Static generate
▸ generate(): Guid
Generates 128-bit UUIDs version 4
Returns: Guid
Returns Guid instance with self generated uuid.
Static getPropTypes
▸ getPropTypes(): Props
Inherited from DefinableMixin.getPropTypes
Overrides CreateEmployee.getPropTypes
Returns: Props
Static getPropertyInitializers
▸ getPropertyInitializers(): Props
Inherited from DefinableMixin.getPropertyInitializers
Overrides CreateEmployee.getPropertyInitializers
Returns: Props
Static getTypeName
▸ getTypeName(): TypeName
Inherited from SerializableMixin.getTypeName
Overrides CreateEmployee.getTypeName
Returns: TypeName
Static isValid
▸ isValid(id: string): boolean
Evaluates if provided guid is matching UUID v4 pattern.
Parameters:
| Name | Type | Description | 
|---|---|---|
id | string | Evaluated identifier for Guid. | 
Returns: boolean
Returns true if id is a string matching UUID v4 pattern, else false.
Static toString
▸ toString(): TypeName
Inherited from SerializableMixin.toString
Overrides CreateEmployee.toString
Returns: TypeName
Static typeName
▸ typeName(): TypeName
Inherited from EjsonableMixin.typeName
Overrides CreateEmployee.typeName
Returns: TypeName