# NameFormatter

A convenience class used for modeling names that have multiple parts and need multiple generators to create them.

*Implements: Archigen.IGenerator\<System.String>*

## Constructors

| Constructor                         | Description                                                                                                                                                                                                                                                                                                                                                                                                                            |
| ----------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| NameFormatter(System.String format) | Instantiates a new [NameFormatter](https://sacro.gitbook.io/syllabore/class-docs/nameformatter) with the specified format. Substrings that need to be replaced with a generated name should be surrounded with curly brackets. For example, the format "John {middle-name} Smith" tells a [NameFormatter](https://sacro.gitbook.io/syllabore/class-docs/nameformatter) that the name between the first and last needs to be generated. |

## Methods

| Method                                                                                                                                                                                                    | Returns                                                                      | Description                                                            |
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------- |
| Define(System.String propertyName, Archigen.IGenerator \<System.String> nameGenerator, [NameFormat](https://sacro.gitbook.io/syllabore/class-docs/nameformat) stringCase, System.Boolean useLeadingSpace) | [NameFormatter](https://sacro.gitbook.io/syllabore/class-docs/nameformatter) |                                                                        |
| Next()                                                                                                                                                                                                    | System.String                                                                | Returns a new generated name based on the previously specified format. |

## Properties

| Property            | Type                                                                                                                                                                | Description                                                                                                                                                                                                                                                                                                                   |
| ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| BoundNameGenerators | System.Collections.Generic.Dictionary \<System.String,Archigen.IGenerator \<System.String>>                                                                         | The [NameGenerator](https://sacro.gitbook.io/syllabore/class-docs/namegenerator) used by this [NameFormatter](https://sacro.gitbook.io/syllabore/class-docs/nameformatter).                                                                                                                                                   |
| Format              | System.String                                                                                                                                                       | The desired format for names. Surround substrings that need to be replaced with a generated name with curly brackets. For example, the format "John {middle-name} Smith" tells a [NameFormatter](https://sacro.gitbook.io/syllabore/class-docs/nameformatter) that the name between the first and last needs to be generated. |
| Options             | System.Collections.Generic.Dictionary \<System.String,[NameFormatterGeneratorOptions](https://sacro.gitbook.io/syllabore/class-docs/nameformattergeneratoroptions)> | Provides hints on whether a name should be upper case, lower case, capitalized, etc.                                                                                                                                                                                                                                          |
