Class LdValue.ObjectBuilder
An object returned by BuildObject() for building an object from keys and values.
Inheritance
Namespace: LaunchDarkly.Sdk
Assembly: LaunchDarkly.CommonSdk.dll
Syntax
public sealed class ObjectBuilder : Object
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 |
---|---|---|
System.String | key | the key to add |
LdValue | value | the value to add |
Returns
Type | Description |
---|---|
LdValue.ObjectBuilder | the same builder |
Add(String, Boolean)
Adds a key-value pair to the object being built.
Declaration
public LdValue.ObjectBuilder Add(string key, bool value)
Parameters
Type | Name | Description |
---|---|---|
System.String | key | the key to add |
System.Boolean | 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 |
---|---|---|
System.String | key | the key to add |
System.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, Int64)
Adds a key-value pair to the object being built.
Declaration
public LdValue.ObjectBuilder Add(string key, long value)
Parameters
Type | Name | Description |
---|---|---|
System.String | key | the key to add |
System.Int64 | 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 |
---|---|---|
System.String | key | the key to add |
System.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 |
---|---|---|
System.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 |
---|---|---|
System.String | key | the key |
LdValue | value | the value to add or replace |
Returns
Type | Description |
---|---|
LdValue.ObjectBuilder | the same builder |
Set(String, Boolean)
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 |
---|---|---|
System.String | key | the key |
System.Boolean | 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 |
---|---|---|
System.String | key | the key |
System.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, Int64)
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 |
---|---|---|
System.String | key | the key |
System.Int64 | 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 |
---|---|---|
System.String | key | the key |
System.String | value | the value to add or replace |
Returns
Type | Description |
---|---|
LdValue.ObjectBuilder | the same builder |