JSONValue
Swift
- Python Unavailable
- Ruby Unavailable
- Lua Unavailable
- TypeScript Unavailable
- Rust Unavailable
- Go Unavailable
- Java Unavailable
- .NET Unavailable
- C++ Unavailable
- Swift
-
Just enough JSON to carry ids, arguments and results through without knowing their shape.
An id is echoed back exactly as it arrived — a client that sends a string id and receives a number will not match them up.
Members
- functionstatic ¶!=(_:_:)
-
Inherited from
Equatable.!=(_:_:)Returns a Boolean value indicating whether two values are not equal.
Inequality is the inverse of equality. For any values
aandb,a != bimplies thata == bisfalse.This is the default implementation of the not-equal-to operator (
!=) for any type that conforms toEquatable.- Parameters:
- lhs: A value to compare.
- rhs: Another value to compare.
- Parameters:
-
Creates a new instance by decoding from the given decoder.
This initializer throws an error if reading from the decoder fails, or if the data read is corrupted or otherwise invalid.
- Parameter decoder: The decoder to read data from.
-
Encodes this value into the given encoder.
If the value fails to encode anything,
encoderwill encode an empty keyed container in its place.This function throws an error if any values are invalid for the given encoder's format.
- Parameter encoder: The encoder to write data to.
- stringValue : var stringValue: String?
- doubleValue : var doubleValue: Double?
- arrayValue : var arrayValue: [JSONValue]?
- objectValue : var objectValue: [String : JSONValue]?
-
Returns a Boolean value indicating whether two values are equal.
Equality is the inverse of inequality. For any values
aandb,a == bimplies thata != bisfalse.- Parameters:
- lhs: A value to compare.
- rhs: Another value to compare.
- Parameters:
-
Hashes the essential components of this value by feeding them into the given hasher.
Implement this method to conform to the
Hashableprotocol. The components used for hashing must be the same as the components compared in your type's==operator implementation. Callhasher.combine(_:)with each of these components.- Important: In your implementation of
hash(into:), don't callfinalize()on thehasherinstance provided, or replace it with a different instance. Doing so may become a compile-time error in the future. - Parameter hasher: The hasher to use when combining the components of this instance.
- Important: In your implementation of