This is a convenience class providing utilities to help identity a particular Domain User. A guid is the best means of uniquely identifing a user within a domain, which combines their userType with username.

DomainUserIds are read-only.

### Hierarchy

- DomainUserId

## Index

### Constructors

- constructor

### Properties

- userType
- username

### Methods

- equals
- toGuid
- anonymous
- guid
- normal
- toDomainUserId

## Constructors

### constructor

- new DomainUserId(userType: DomainUserType, username: string): DomainUserId

- Constructs a `DomainUserId` from the given user type and username.

  #### Parameters

  - ##### userType: DomainUserType

    the type of user

  - ##### username: string

    the user's username

  #### Returns DomainUserId

## Properties

### userType

userType: DomainUserType

the type of user

### username

username: string

the user's username

## Methods

### equals

- equals(other: DomainUserId): boolean

- Returns true if this user is the same as the given user.

  #### Parameters

  - ##### other: DomainUserId

    another domain user

  #### Returns boolean

### toGuid

- toGuid(): string

- Returns a string GUID for this user guaranteed to be unique within this domain.

  #### Returns string

### Staticanonymous

- anonymous(username: string): DomainUserId

- Constructs a "anonymous" `DomainUserId` by username.

  #### Parameters

  - ##### username: string

    the anonymous unique users username.

  #### Returns DomainUserId

### Staticguid

- guid(userType: DomainUserType, username: string): string

- Constructs a GUID from the given user type and username.

  Equivalent to `new DomainUserId(userType, username).toGuid()`

  #### Parameters

  - ##### userType: DomainUserType

    the type of user

  - ##### username: string

    the user's username

  #### Returns string

### Staticnormal

- normal(username: string): DomainUserId

- Constructs a "normal" `DomainUserId` by username.

  #### Parameters

  - ##### username: string

    an existing DomainUser's username

  #### Returns DomainUserId

### StatictoDomainUserId

- toDomainUserId(userId: DomainUserIdentifier): DomainUserId

- This is a convenience function to construct a `DomainUserId` from a bare username.

  #### Parameters

  - ##### userId: DomainUserIdentifier

    a "normal" user's username or DomainUserId

  #### Returns DomainUserId