Class LdValue.Convert
Predefined instances of LdValue.Converter<T> for commonly used types.
Inherited Members
Namespace: LaunchDarkly.Sdk
Assembly: LaunchDarkly.CommonSdk.dll
Syntax
public static class LdValue.Convert
Remarks
These are mostly useful for methods that convert LdValue to or from a collection of some type, such as ArrayOf(params T[]) and AsList<T>(Converter<T>).
Fields
Bool
A LdValue.Converter<T> for the bool type.
Declaration
public static readonly LdValue.Converter<bool> Bool
Field Value
Type | Description |
---|---|
LdValue.Converter<bool> |
Remarks
Double
A LdValue.Converter<T> for the double type.
Declaration
public static readonly LdValue.Converter<double> Double
Field Value
Type | Description |
---|---|
LdValue.Converter<double> |
Remarks
Its behavior is consistent with Of(double) and AsDouble.
Float
A LdValue.Converter<T> for the float type.
Declaration
public static readonly LdValue.Converter<float> Float
Field Value
Type | Description |
---|---|
LdValue.Converter<float> |
Remarks
Int
A LdValue.Converter<T> for the int type.
Declaration
public static readonly LdValue.Converter<int> Int
Field Value
Type | Description |
---|---|
LdValue.Converter<int> |
Remarks
Json
A LdValue.Converter<T> that indicates the value is an LdValue and does not need to be converted.
Declaration
public static readonly LdValue.Converter<LdValue> Json
Field Value
Type | Description |
---|---|
LdValue.Converter<LdValue> |
Long
A LdValue.Converter<T> for the long type.
Declaration
public static readonly LdValue.Converter<long> Long
Field Value
Type | Description |
---|---|
LdValue.Converter<long> |
Remarks
Its behavior is consistent with Of(long) and AsLong.
Note that the LaunchDarkly service, and most of the SDKs, represent numeric values internally in 64-bit floating-point, which has slightly less precision than a signed 64-bit long; therefore, the full range of long values cannot be accurately represented. If you need to set a user attribute to a numeric value with more significant digits than will fit in a double, it is best to encode it as a string.
String
A LdValue.Converter<T> for the string type.
Declaration
public static readonly LdValue.Converter<string> String
Field Value
Type | Description |
---|---|
LdValue.Converter<string> |
Remarks
Its behavior is consistent with Of(string) and AsString.