# Class: Namespace

## ProtoBuf .Reflect. Namespace

#### new Namespace(buildernon-null, parentnullable, name, optionsopt)

  Constructs a new Namespace.

  ##### Parameters:

  Name | Type | Attributes | Description
  --- | --- | --- | ---
  `builder` | ProtoBuf.Builder |  | Builder reference
  `parent` | ProtoBuf.Reflect.Namespace | <nullable> | Namespace parent
  `name` | string |  | Namespace name
  `options` | Object.<string, *> | <optional> | Namespace options

  Source:
    - ProtoBuf.js, line 1434

### Extends

- ProtoBuf.Reflect.T

### Members

#### (non-null) builder :ProtoBuf.Builder

  Builder reference.

  ##### Type:

  - ProtoBuf.Builder
  Inherited From:
    - ProtoBuf.Reflect.T#builder
  Source:
    - ProtoBuf.js, line 1352

#### (non-null) children :Array.<ProtoBuf.Reflect.T>

  Children inside the namespace.

  ##### Type:

  - Array.<ProtoBuf.Reflect.T>
  Source:
    - ProtoBuf.js, line 1446

#### className

  Source:
    - ProtoBuf.js, line 1440

#### name :string

  Object name in namespace.

  ##### Type:

  - string
  Inherited From:
    - ProtoBuf.Reflect.T#name
  Source:
    - ProtoBuf.js, line 1366

#### (non-null) options :Object.<string, *>

  Options.

  ##### Type:

  - Object.<string, *>
  Source:
    - ProtoBuf.js, line 1452

#### (nullable) parent :ProtoBuf.Reflect.T

  Parent object.

  ##### Type:

  - ProtoBuf.Reflect.T
  Inherited From:
    - ProtoBuf.Reflect.T#parent
  Source:
    - ProtoBuf.js, line 1359

### Methods

#### addChild(child)

  Adds a child to the namespace.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `child` | ProtoBuf.Reflect.T | Child

  Source:
    - ProtoBuf.js, line 1484

  ##### Throws:

  If the child cannot be added (duplicate)
  Type
    Error

#### build() → {Object.<string, (function()|Object)>}

  Builds the namespace and returns the runtime counterpart.

  Source:
    - ProtoBuf.js, line 1553

  ##### Returns:

  Runtime namespace

  Type
    Object.<string, (function()|Object)>

#### buildOpt() → {Object.<string, *>}

  Builds the namespace's '$options' property.

  Source:
    - ProtoBuf.js, line 1571

  ##### Returns:

  Type
    Object.<string, *>

#### fqn() → {string}

  Returns the fully qualified name of this object.

  Inherited From:
    - ProtoBuf.Reflect.T#fqn
  Source:
    - ProtoBuf.js, line 1387

  ##### Returns:

  Fully qualified name as of ".PATH.TO.THIS"

  Type
    string

#### getChild(nameOrId) → (nullable) {ProtoBuf.Reflect.T}

  Gets a child by its name or id.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `nameOrId` | string | number | Child name or id

  Source:
    - ProtoBuf.js, line 1504

  ##### Returns:

  The child or null if not found

  Type
    ProtoBuf.Reflect.T

#### getChildren(typeopt) → {Array.<ProtoBuf.Reflect.T>}

  Returns an array of the namespace's children.

  ##### Parameters:

  Name | Type | Attributes | Description
  --- | --- | --- | ---
  `type` | ProtoBuf.Reflect.T | <optional> | Filter type (returns instances of this type only). Defaults to null (all children).

  Source:
    - ProtoBuf.js, line 1467

  ##### Returns:

  Type
    Array.<ProtoBuf.Reflect.T>

#### getOption(nameopt) → {*|Object.<string, *>}

  Gets the value assigned to the option with the specified name.

  ##### Parameters:

  Name | Type | Attributes | Description
  --- | --- | --- | ---
  `name` | string | <optional> | Returns the option value if specified, otherwise all options are returned.

  Source:
    - ProtoBuf.js, line 1592

  ##### Returns:

  null} Option value or NULL if there is no such option

  Type
    * | Object.<string, *>

#### resolve(qn, excludeFieldsopt) → (nullable) {ProtoBuf.Reflect.Namespace}

  Resolves a reflect object inside of this namespace.

  ##### Parameters:

  Name | Type | Attributes | Description
  --- | --- | --- | ---
  `qn` | string |  | Qualified name to resolve
  `excludeFields` | boolean | <optional> | Excludes fields, defaults to `false`

  Source:
    - ProtoBuf.js, line 1519

  ##### Returns:

  The resolved type or null if not found

  Type
    ProtoBuf.Reflect.Namespace

#### toString(includeClassopt)

  Returns a string representation of this Reflect object (its fully qualified name).

  ##### Parameters:

  Name | Type | Attributes | Description
  --- | --- | --- | ---
  `includeClass` | boolean | <optional> | Set to true to include the class name. Defaults to false.

  Inherited From:
    - ProtoBuf.Reflect.T#toString
  Source:
    - ProtoBuf.js, line 1405

  ##### Returns:

  String representation