Class ScyllaMapDOTS<TKey, TValue>.Builder
Fluent builder for configuring and constructing ScyllaMapDOTS<TKey, TValue> instances.
Inherited Members
Namespace: Scylla.Core.Structures
Assembly: ScyllaCore.dll
Syntax
public sealed class ScyllaMapDOTS<TKey, TValue>.Builder
Methods
Build()
Builds and returns the configured ScyllaMapDOTS instance.
Declaration
public ScyllaMapDOTS<TKey, TValue> Build()
Returns
| Type | Description |
|---|---|
| ScyllaMapDOTS<TKey, TValue> | The configured ScyllaMapDOTS instance |
Remarks
Validates that WithAllocator(Allocator) has been called before constructing the map. Since ScyllaMapDOTS doesn't have a synchronized wrapper, this method returns the concrete type directly.
Exceptions
| Type | Condition |
|---|---|
| InvalidOperationException | Thrown when allocator has not been set via WithAllocator() |
BuildConcrete()
Builds and returns the concrete ScyllaMapDOTS instance. This method is functionally identical to Build() since ScyllaMapDOTS doesn't have a synchronized wrapper.
Declaration
public ScyllaMapDOTS<TKey, TValue> BuildConcrete()
Returns
| Type | Description |
|---|---|
| ScyllaMapDOTS<TKey, TValue> | The configured ScyllaMapDOTS instance |
Remarks
Validates that WithAllocator(Allocator) has been called before constructing the map. This method exists for API consistency with other collection builders, but returns the same type as Build().
Exceptions
| Type | Condition |
|---|---|
| InvalidOperationException | Thrown when allocator has not been set via WithAllocator() |
WithAllocator(Allocator)
Sets the memory allocator for native containers. This method must be called before Build() or BuildConcrete().
Declaration
public ScyllaMapDOTS<TKey, TValue>.Builder WithAllocator(Allocator allocator)
Parameters
| Type | Name | Description |
|---|---|---|
| Allocator | allocator | Memory allocator for native containers (must not be Allocator.None) |
Returns
| Type | Description |
|---|---|
| ScyllaMapDOTS<TKey, TValue>.Builder | This builder instance for method chaining |
Remarks
Allocator Selection:
- Allocator.Persistent: Long-lived map (recommended for most game scenarios)
- Allocator.TempJob: Map used within a single frame across jobs
- Allocator.Temp: Short-lived map used within a single frame
Validation:
Allocator.None is not allowed and will throw an ArgumentException.
Exceptions
| Type | Condition |
|---|---|
| ArgumentException | Thrown when allocator is Allocator.None |
WithCapacity(int)
Sets the fixed capacity of the map.
Declaration
public ScyllaMapDOTS<TKey, TValue>.Builder WithCapacity(int capacity)
Parameters
| Type | Name | Description |
|---|---|---|
| int | capacity | The fixed capacity. Must be at least 0. If negative, will be clamped to 1 during construction. |
Returns
| Type | Description |
|---|---|
| ScyllaMapDOTS<TKey, TValue>.Builder | This builder instance for method chaining |
Remarks
The capacity will be rounded up to at least 1 during construction.
Exceptions
| Type | Condition |
|---|---|
| ArgumentOutOfRangeException | Thrown when capacity is negative |