Class LdValue.ObjectBuilder
An object returned by BuildObject() for building an object from keys and values.
Inherited Members
Namespace: LaunchDarkly.Sdk
Assembly: LaunchDarkly.CommonSdk.dll
Syntax
public sealed class LdValue.ObjectBuilder
Methods
Add(string, LdValue)
Adds a key-value pair to the object being built.
Declaration
public LdValue.ObjectBuilder Add(string key, LdValue value)
Parameters
Type | Name | Description |
---|---|---|
string | key | the key to add |
LdValue | value | the value to add |
Returns
Type | Description |
---|---|
LdValue.ObjectBuilder | the same builder |
Add(string, bool)
Adds a key-value pair to the object being built.
Declaration
public LdValue.ObjectBuilder Add(string key, bool value)
Parameters
Type | Name | Description |
---|---|---|
string | key | the key to add |
bool | value | the value to add |
Returns
Type | Description |
---|---|
LdValue.ObjectBuilder | the same builder |
Add(string, double)
Adds a key-value pair to the object being built.
Declaration
public LdValue.ObjectBuilder Add(string key, double value)
Parameters
Type | Name | Description |
---|---|---|
string | key | the key to add |
double | value | the value to add |
Returns
Type | Description |
---|---|
LdValue.ObjectBuilder | the same builder |
Remarks
Numeric values in LaunchDarkly have some precision limitations. For more details, see our documentation on flag value types.
Add(string, long)
Adds a key-value pair to the object being built.
Declaration
public LdValue.ObjectBuilder Add(string key, long value)
Parameters
Type | Name | Description |
---|---|---|
string | key | the key to add |
long | value | the value to add |
Returns
Type | Description |
---|---|
LdValue.ObjectBuilder | the same builder |
Remarks
Numeric values in LaunchDarkly have some precision limitations. For more details, see our documentation on flag value types.
Add(string, string)
Adds a key-value pair to the object being built.
Declaration
public LdValue.ObjectBuilder Add(string key, string value)
Parameters
Type | Name | Description |
---|---|---|
string | key | the key to add |
string | value | the value to add |
Returns
Type | Description |
---|---|
LdValue.ObjectBuilder | the same builder |
Build()
Returns an object value containing the keys and values provided so far.
Declaration
public LdValue Build()
Returns
Type | Description |
---|---|
LdValue | an immutable object LdValue |
Copy(LdValue)
Copies existing property keys and values from an existing JSON object; does nothing if the value is not an object.
Declaration
public LdValue.ObjectBuilder Copy(LdValue fromObject)
Parameters
Type | Name | Description |
---|---|---|
LdValue | fromObject | a JSON value |
Returns
Type | Description |
---|---|
LdValue.ObjectBuilder | the same builder |
Remove(string)
Removes a key from the object, or does nothing if no such key exists.
Declaration
public LdValue.ObjectBuilder Remove(string key)
Parameters
Type | Name | Description |
---|---|---|
string | key | the key |
Returns
Type | Description |
---|---|
LdValue.ObjectBuilder | the same builder |
Set(string, LdValue)
Adds a key-value pair to the object being built or replaces an existing key.
Declaration
public LdValue.ObjectBuilder Set(string key, LdValue value)
Parameters
Type | Name | Description |
---|---|---|
string | key | the key |
LdValue | value | the value to add or replace |
Returns
Type | Description |
---|---|
LdValue.ObjectBuilder | the same builder |
Set(string, bool)
Adds a key-value pair to the object being built or replaces an existing key.
Declaration
public LdValue.ObjectBuilder Set(string key, bool value)
Parameters
Type | Name | Description |
---|---|---|
string | key | the key |
bool | value | the value to add or replace |
Returns
Type | Description |
---|---|
LdValue.ObjectBuilder | the same builder |
Set(string, double)
Adds a key-value pair to the object being built or replaces an existing key.
Declaration
public LdValue.ObjectBuilder Set(string key, double value)
Parameters
Type | Name | Description |
---|---|---|
string | key | the key |
double | value | the value to add or replace |
Returns
Type | Description |
---|---|
LdValue.ObjectBuilder | the same builder |
Remarks
Numeric values in LaunchDarkly have some precision limitations. For more details, see our documentation on flag value types.
Set(string, long)
Adds a key-value pair to the object being built or replaces an existing key.
Declaration
public LdValue.ObjectBuilder Set(string key, long value)
Parameters
Type | Name | Description |
---|---|---|
string | key | the key |
long | value | the value to add or replace |
Returns
Type | Description |
---|---|
LdValue.ObjectBuilder | the same builder |
Remarks
Numeric values in LaunchDarkly have some precision limitations. For more details, see our documentation on flag value types.
Set(string, string)
Adds a key-value pair to the object being built or replaces an existing key.
Declaration
public LdValue.ObjectBuilder Set(string key, string value)
Parameters
Type | Name | Description |
---|---|---|
string | key | the key |
string | value | the value to add or replace |
Returns
Type | Description |
---|---|
LdValue.ObjectBuilder | the same builder |