LDValue

public enum LDValue: Codable,
                     Equatable,
                     ExpressibleByNilLiteral,
                     ExpressibleByBooleanLiteral,
                     ExpressibleByIntegerLiteral,
                     ExpressibleByFloatLiteral,
                     ExpressibleByStringLiteral,
                     ExpressibleByArrayLiteral,
                     ExpressibleByDictionaryLiteral

An immutable instance of any data type that is allowed in JSON.

An LDValue can be a null (that is, an instance that represents a JSON null value), a boolean, a number (always encoded internally as double-precision floating-point), a string, an ordered list of LDValue values (a JSON array), or a map of strings to LDValue values (a JSON object).

This can be used to represent complex data in a context attribute, or to get a feature flag value that uses a complex type or does not always use the same type.

  • Declaration

    Swift

    public typealias StringLiteralType = String
  • Declaration

    Swift

    public typealias ArrayLiteralElement = LDValue
  • Key

    Declaration

    Swift

    public typealias Key = String
  • Declaration

    Swift

    public typealias Value = LDValue
  • Declaration

    Swift

    public typealias IntegerLiteralType = Double
  • Declaration

    Swift

    public typealias FloatLiteralType = Double
  • Represents a JSON null value.

    Declaration

    Swift

    case null
  • Represents a JSON boolean value.

    Declaration

    Swift

    case bool(Bool)
  • Represents a JSON number value.

    Declaration

    Swift

    case number(Double)
  • Represents a JSON string value.

    Declaration

    Swift

    case string(String)
  • Represents an array of JSON values.

    Declaration

    Swift

    case array([LDValue])
  • Represents a JSON object.

    Declaration

    Swift

    case object([String : LDValue])
  • Declaration

    Swift

    public init(nilLiteral: ())
  • Declaration

    Swift

    public init(booleanLiteral: Bool)
  • Declaration

    Swift

    public init(integerLiteral: Double)
  • Declaration

    Swift

    public init(floatLiteral: Double)
  • Declaration

    Swift

    public init(stringLiteral: String)
  • Declaration

    Swift

    public init(arrayLiteral: LDValue...)
  • Declaration

    Swift

    public init(dictionaryLiteral: (String, LDValue)...)
  • Declaration

    Swift

    public init(from decoder: Decoder) throws
  • Declaration

    Swift

    public func encode(to encoder: Encoder) throws