# IPortBuilder<T>

> Base interface representing a generic port builder. Used in a builder pattern to configure and construct ports.

## Definition

* **Type:** Interface
* **Namespace:** [Unity.GraphToolkit.Editor](/engine/6000.7/script-reference/unity/graphtoolkit/editor.md)
* **Assembly:** UnityEditor

```csharp
public interface IPortBuilder<T>
```

## Remarks

This interface supports a builder pattern, where each method returns the builder instance, allowing chained configuration of port settings before final construction using [IPortBuilder\<T>.Build()](/engine/6000.7/script-reference/unity/graphtoolkit/editor/iportbuilder1/build.md). Use derived interfaces such as [IInputPortBuilder](/engine/6000.7/script-reference/unity/graphtoolkit/editor/iinputportbuilder.md) or [IOutputPortBuilder](/engine/6000.7/script-reference/unity/graphtoolkit/editor/ioutputportbuilder.md) to build specific port types.

## Examples

```csharp
context.AddInputPort("MyInput")
       .WithDataType(typeof(int))
       .WithDisplayName("Input Value")
       .Build();
```

## Methods

| Method                                                                                                        | Description                                                                                                                                                          |
| ------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [AsVertical](/engine/6000.7/script-reference/unity/graphtoolkit/editor/iportbuilder1/asvertical.md)           | Configures the port to be built as a vertical port.                                                                                                                  |
| [Build](/engine/6000.7/script-reference/unity/graphtoolkit/editor/iportbuilder1/build.md)                     | Builds and returns the final [IPort](/engine/6000.7/script-reference/unity/graphtoolkit/editor/iport.md) instance based on the current configuration of the builder. |
| [WithCapacity](/engine/6000.7/script-reference/unity/graphtoolkit/editor/iportbuilder1/withcapacity.md)       | Configures the connection capacity of the port being built.                                                                                                          |
| [WithConnectorUI](/engine/6000.7/script-reference/unity/graphtoolkit/editor/iportbuilder1/withconnectorui.md) | Configures the connector UI shape for the port being built.                                                                                                          |
| [WithDisplayName](/engine/6000.7/script-reference/unity/graphtoolkit/editor/iportbuilder1/withdisplayname.md) | Configures the display name of the port being built.                                                                                                                 |
| [WithTooltip](/engine/6000.7/script-reference/unity/graphtoolkit/editor/iportbuilder1/withtooltip.md)         | Configures the tooltip text of the port being built.                                                                                                                 |
