A enum for storing and retrieving values associated with an AnyRealmValue
property. AnyRealmValue
can also store a collection (List, Dictionary) of AnyRealmValue
, meaning that you can have nested collections inside a AnyRealmValue
.
A floating point numeric type.
A double numeric type.
DeclarationSwift
case double(Double)
A string type.
DeclarationSwift
case string(String)
Dictionary type.
DeclarationSwift
case dictionary(Map<String, AnyRealmValue>)
List type.
DeclarationSwift
case list(List<AnyRealmValue>)
Returns an Int
if that is what the stored value is, otherwise nil
.
Swift
public var intValue: Int? { get }
Returns a Bool
if that is what the stored value is, otherwise nil
.
Swift
public var boolValue: Bool? { get }
Returns a Float
if that is what the stored value is, otherwise nil
.
Swift
public var floatValue: Float? { get }
Returns a Double
if that is what the stored value is, otherwise nil
.
Swift
public var doubleValue: Double? { get }
Returns a String
if that is what the stored value is, otherwise nil
.
Swift
public var stringValue: String? { get }
Returns Data
if that is what the stored value is, otherwise nil
.
Swift
public var dataValue: Data? { get }
Returns a Date
if that is what the stored value is, otherwise nil
.
Swift
public var dateValue: Date? { get }
Returns an ObjectId
if that is what the stored value is, otherwise nil
.
Swift
public var objectIdValue: ObjectId? { get }
Returns a Decimal128
if that is what the stored value is, otherwise nil
.
Swift
public var decimal128Value: Decimal128? { get }
Returns a UUID
if that is what the stored value is, otherwise nil
.
Swift
public var uuidValue: UUID? { get }
Returns the stored value as a Realm Object of a specific type.
DeclarationSwift
public func object<T>(_ objectType: T.Type) -> T? where T : RealmSwiftObject
Parameters objectType
The type of the Object to return.
Return ValueA Realm Object of the supplied type if that is what the underlying value is, otherwise nil
is returned.
Returns a Map<String, AnyRealmValue>
if that is what the stored value is, otherwise nil
.
Swift
public var dictionaryValue: Map<String, AnyRealmValue>? { get }
Returns a List<AnyRealmValue>
if that is what the stored value is, otherwise nil
.
Swift
public var listValue: List<AnyRealmValue>? { get }
Returns a DynamicObject
if the stored value is an Object
, otherwise nil
.
Note: This allows access to an object stored in AnyRealmValue
where you may not have the class information associated for it. For example if you are using Realm Sync and version 2 of your app sets an object into AnyRealmValue
and that class does not exist in version 1 use this accessor to gain access to the object in the Realm.
Swift
public var dynamicObject: DynamicObject? { get }
Returns a AnyRealmValue
storing a Map
.
Swift
public static func fromDictionary(_ dictionary: Dictionary<String, AnyRealmValue>) -> AnyRealmValue
Parameters dictionary
A Swift’s dictionary of AnyRealmValue
values.
Returns an AnyRealmValue
storing a Map
.
Returns a AnyRealmValue
storing a List
.
Swift
public static func fromArray(_ array: Array<AnyRealmValue>) -> AnyRealmValue
Parameters array
A Swift’s array of AnyRealmValue
.
Returns a AnyRealmValue
storing a List
.
Swift
public func hash(into hasher: inout Hasher)
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4