Class SearchAttributeCollection.Builder
- Namespace
- Temporalio.Common
- Assembly
- Temporalio.dll
Builder for creating SearchAttributeCollection. This builder is not thread safe.
public class SearchAttributeCollection.Builder
- Inheritance
-
SearchAttributeCollection.Builder
- Inherited Members
Constructors
Builder()
Initializes a new instance of the SearchAttributeCollection.Builder class to an empty set.
public Builder()
Builder(SearchAttributeCollection)
Initializes a new instance of the SearchAttributeCollection.Builder class with a copy of existing values.
public Builder(SearchAttributeCollection searchAttributes)
Parameters
searchAttributes
SearchAttributeCollectionExisting values to copy.
Methods
Set(SearchAttributeCollection)
Set a copy of all values in the given collection as if calling Set<T>(SearchAttributeKey<T>, T) on each.
public SearchAttributeCollection.Builder Set(SearchAttributeCollection searchAttributes)
Parameters
searchAttributes
SearchAttributeCollectionSearch attributes to copy.
Returns
- SearchAttributeCollection.Builder
This builder for chaining.
Remarks
This will replace any existing key of the same name regardless of key type.
Set<T>(SearchAttributeKey<T>, T)
Set a specific key and value.
public SearchAttributeCollection.Builder Set<T>(SearchAttributeKey<T> key, T value) where T : notnull
Parameters
key
SearchAttributeKey<T>Key to set.
value
TValue to set.
Returns
- SearchAttributeCollection.Builder
This builder for chaining.
Type Parameters
T
Key type.
Remarks
This will replace any existing key of the same name regardless of key type.
ToSearchAttributeCollection()
Build the search attribute collection.
public SearchAttributeCollection ToSearchAttributeCollection()
Returns
- SearchAttributeCollection
Built collection.
Remarks
This copies the internal values when creating, so this builder can be reused.
Unset(string)
Remove the key for the given key name regardless of key type.
public SearchAttributeCollection.Builder Unset(string name)
Parameters
name
stringKey name to remove.
Returns
- SearchAttributeCollection.Builder
This builder for chaining.
Unset(SearchAttributeKey)
Remove the key for the given key name regardless of key type.
public SearchAttributeCollection.Builder Unset(SearchAttributeKey key)
Parameters
key
SearchAttributeKeyKey with the name to remove.
Returns
- SearchAttributeCollection.Builder
This builder for chaining.