Struct SerializedObjectView
A view on top of the Packed
Inherited Members
Namespace: Unity.Serialization.Json
Assembly: Unity.Serialization.dll
Syntax
public readonly struct SerializedObjectView : IEnumerable<SerializedMemberView>, IEnumerable
Properties
this[string]
Gets the value associated with the specified key.
Declaration
public SerializedValueView this[string name] { get; }
Parameters
Type | Name | Description |
---|---|---|
string | name | The key of the value to get. |
Property Value
Type | Description |
---|---|
Serialized |
Exceptions
Type | Condition |
---|---|
Key |
The key does not exist in the collection. |
this[FixedString128Bytes]
Gets the value associated with the specified key.
Declaration
public SerializedValueView this[in FixedString128Bytes name] { get; }
Parameters
Type | Name | Description |
---|---|---|
Fixed |
name | The key of the value to get. |
Property Value
Type | Description |
---|---|
Serialized |
Exceptions
Type | Condition |
---|---|
Key |
The key does not exist in the collection. |
this[FixedString32Bytes]
Gets the value associated with the specified key.
Declaration
public SerializedValueView this[in FixedString32Bytes name] { get; }
Parameters
Type | Name | Description |
---|---|---|
Fixed |
name | The key of the value to get. |
Property Value
Type | Description |
---|---|
Serialized |
Exceptions
Type | Condition |
---|---|
Key |
The key does not exist in the collection. |
this[FixedString64Bytes]
Gets the value associated with the specified key.
Declaration
public SerializedValueView this[in FixedString64Bytes name] { get; }
Parameters
Type | Name | Description |
---|---|---|
Fixed |
name | The key of the value to get. |
Property Value
Type | Description |
---|---|
Serialized |
Exceptions
Type | Condition |
---|---|
Key |
The key does not exist in the collection. |
Methods
GetEnumerator()
Returns an enumerator that iterates through the Serialized
Declaration
public SerializedObjectView.Enumerator GetEnumerator()
Returns
Type | Description |
---|---|
Serialized |
A Serialized |
GetMember(string)
Gets the member associated with the specified key.
Declaration
public SerializedMemberView GetMember(string name)
Parameters
Type | Name | Description |
---|---|---|
string | name | The key of the member to get. |
Returns
Type | Description |
---|---|
Serialized |
Returns the member associated with the specified key. |
GetMember<T>(in T)
Gets the member associated with the specified key.
Declaration
public SerializedMemberView GetMember<T>(in T name) where T : unmanaged, INativeList<byte>, IUTF8Bytes
Parameters
Type | Name | Description |
---|---|---|
T | name | The key of the member to get. |
Returns
Type | Description |
---|---|
Serialized |
Returns the member associated with the specified key. |
Type Parameters
Name | Description |
---|---|
T | The fixed string type. |
GetValue(string)
Gets the value associated with the specified key.
Declaration
public SerializedValueView GetValue(string name)
Parameters
Type | Name | Description |
---|---|---|
string | name | The key of the value to get. |
Returns
Type | Description |
---|---|
Serialized |
Returns the value associated with the specified key. |
GetValue<T>(in T)
Gets the value associated with the specified key.
Declaration
public SerializedValueView GetValue<T>(in T name) where T : unmanaged, INativeList<byte>, IUTF8Bytes
Parameters
Type | Name | Description |
---|---|---|
T | name | The key of the value to get. |
Returns
Type | Description |
---|---|
Serialized |
Returns the value associated with the specified key. |
Type Parameters
Name | Description |
---|---|
T | The fixed string type. |
TryGetMember(string, out SerializedMemberView)
Gets the member associated with the specified key.
Declaration
public bool TryGetMember(string name, out SerializedMemberView member)
Parameters
Type | Name | Description |
---|---|---|
string | name | The key of the member to get. |
Serialized |
member | When this method returns, contains the member associated with the specified key, if the key is found; otherwise, the default value. |
Returns
Type | Description |
---|---|
bool | true if the Serialized |
TryGetMember<T>(in T, out SerializedMemberView)
Gets the member associated with the specified key.
Declaration
public bool TryGetMember<T>(in T name, out SerializedMemberView member) where T : unmanaged, INativeList<byte>, IUTF8Bytes
Parameters
Type | Name | Description |
---|---|---|
T | name | The key of the member to get. |
Serialized |
member | When this method returns, contains the member associated with the specified key, if the key is found; otherwise, the default value. |
Returns
Type | Description |
---|---|
bool | true if the Serialized |
Type Parameters
Name | Description |
---|---|
T | The fixed string type. |
TryGetValue(string, out SerializedValueView)
Gets the value associated with the specified key.
Declaration
public bool TryGetValue(string name, out SerializedValueView value)
Parameters
Type | Name | Description |
---|---|---|
string | name | The key of the value to get. |
Serialized |
value | When this method returns, contains the value associated with the specified key, if the key is found; otherwise, the default value. |
Returns
Type | Description |
---|---|
bool | true if the Serialized |
TryGetValueAsBoolean(string, out bool)
Gets the value associated with the specified key as a bool.
Declaration
public bool TryGetValueAsBoolean(string name, out bool value)
Parameters
Type | Name | Description |
---|---|---|
string | name | The key of the value to get. |
bool | value | When this method returns, contains the value associated with the specified key and type, if the key is found and the type matches; otherwise, the default value. |
Returns
Type | Description |
---|---|
bool | true if the Serialized |
TryGetValueAsDouble(string, out double)
Gets the value associated with the specified key as a double.
Declaration
public bool TryGetValueAsDouble(string name, out double value)
Parameters
Type | Name | Description |
---|---|---|
string | name | The key of the value to get. |
double | value | When this method returns, contains the value associated with the specified key and type, if the key is found and the type matches; otherwise, the default value. |
Returns
Type | Description |
---|---|
bool | true if the Serialized |
TryGetValueAsFloat(string, out float)
Gets the value associated with the specified key as a float.
Declaration
public bool TryGetValueAsFloat(string name, out float value)
Parameters
Type | Name | Description |
---|---|---|
string | name | The key of the value to get. |
float | value | When this method returns, contains the value associated with the specified key and type, if the key is found and the type matches; otherwise, the default value. |
Returns
Type | Description |
---|---|
bool | true if the Serialized |
TryGetValueAsInt64(string, out long)
Gets the value associated with the specified key as a long.
Declaration
public bool TryGetValueAsInt64(string name, out long value)
Parameters
Type | Name | Description |
---|---|---|
string | name | The key of the value to get. |
long | value | When this method returns, contains the value associated with the specified key and type, if the key is found and the type matches; otherwise, the default value. |
Returns
Type | Description |
---|---|
bool | true if the Serialized |
TryGetValueAsString(string, out string)
Gets the value associated with the specified key as a string.
Declaration
public bool TryGetValueAsString(string name, out string value)
Parameters
Type | Name | Description |
---|---|---|
string | name | The key of the value to get. |
string | value | When this method returns, contains the value associated with the specified key and type, if the key is found and the type matches; otherwise, the default value. |
Returns
Type | Description |
---|---|
bool | true if the Serialized |
TryGetValueAsUInt64(string, out ulong)
Gets the value associated with the specified key as a ulong.
Declaration
public bool TryGetValueAsUInt64(string name, out ulong value)
Parameters
Type | Name | Description |
---|---|---|
string | name | The key of the value to get. |
ulong | value | When this method returns, contains the value associated with the specified key and type, if the key is found and the type matches; otherwise, the default value. |
Returns
Type | Description |
---|---|
bool | true if the Serialized |
TryGetValue<T>(in T, out SerializedValueView)
Gets the value associated with the specified key.
Declaration
public bool TryGetValue<T>(in T name, out SerializedValueView value) where T : unmanaged, INativeList<byte>, IUTF8Bytes
Parameters
Type | Name | Description |
---|---|---|
T | name | The key of the value to get. |
Serialized |
value | When this method returns, contains the value associated with the specified key, if the key is found; otherwise, the default value. |
Returns
Type | Description |
---|---|
bool | true if the Serialized |
Type Parameters
Name | Description |
---|---|
T | The fixed string type. |
Operators
implicit operator SerializedValueView(SerializedObjectView)
Re-interprets the specified object view to an untyped value view.
Declaration
public static implicit operator SerializedValueView(SerializedObjectView view)
Parameters
Type | Name | Description |
---|---|---|
Serialized |
view | The object view to re-interpret. |
Returns
Type | Description |
---|---|
Serialized |
The untyped value view for the given object. |