Struct SerializedMemberViewCollection
A structure to hold a collection of SerializedMemberView.
Inherited Members
Namespace: Unity.Serialization.Json
Syntax
public readonly struct SerializedMemberViewCollection : IDisposable, IEnumerable<SerializedMemberView>, IEnumerable
Remarks
This structure is not a view itself but rather a container for views.
Constructors
SerializedMemberViewCollection(Allocator)
Initializes a new instance of SerializedMemberViewCollection using the given allocator.
Declaration
public SerializedMemberViewCollection(Allocator label)
Parameters
Type | Name | Description |
---|---|---|
Allocator | label | The memory allocator label. |
Properties
Item[String]
Gets the value associated with the specified key.
Declaration
public readonly SerializedValueView this[string name] { get; }
Parameters
Type | Name | Description |
---|---|---|
String | name | The key of the value to get. |
Property Value
Type | Description |
---|---|
SerializedValueView |
Exceptions
Type | Condition |
---|---|
KeyNotFoundException | The key does not exist in the collection. |
Item[FixedString128Bytes]
Gets the value associated with the specified key.
Declaration
public readonly SerializedValueView this[FixedString128Bytes name] { get; }
Parameters
Type | Name | Description |
---|---|---|
FixedString128Bytes | name | The key of the value to get. |
Property Value
Type | Description |
---|---|
SerializedValueView |
Exceptions
Type | Condition |
---|---|
KeyNotFoundException | The key does not exist in the collection. |
Item[FixedString32Bytes]
Gets the value associated with the specified key.
Declaration
public readonly SerializedValueView this[FixedString32Bytes name] { get; }
Parameters
Type | Name | Description |
---|---|---|
FixedString32Bytes | name | The key of the value to get. |
Property Value
Type | Description |
---|---|
SerializedValueView |
Exceptions
Type | Condition |
---|---|
KeyNotFoundException | The key does not exist in the collection. |
Item[FixedString64Bytes]
Gets the value associated with the specified key.
Declaration
public readonly SerializedValueView this[FixedString64Bytes name] { get; }
Parameters
Type | Name | Description |
---|---|---|
FixedString64Bytes | name | The key of the value to get. |
Property Value
Type | Description |
---|---|
SerializedValueView |
Exceptions
Type | Condition |
---|---|
KeyNotFoundException | The key does not exist in the collection. |
Methods
Add(SerializedMemberView)
Adds the specified SerializedMemberView to the collection.
Declaration
public readonly void Add(SerializedMemberView view)
Parameters
Type | Name | Description |
---|---|---|
SerializedMemberView | view | The value of to add. |
Dispose()
Releases all resources used by the SerializedMemberViewCollection.
Declaration
public readonly void Dispose()
Implements
GetEnumerator()
Returns an enumerator that iterates through the SerializedMemberViewCollection.
Declaration
public readonly SerializedMemberViewCollection.Enumerator GetEnumerator()
Returns
Type | Description |
---|---|
SerializedMemberViewCollection.Enumerator | A SerializedMemberViewCollection.Enumerator for the SerializedMemberViewCollection. |
GetValue(String)
Gets the value associated with the specified key.
Declaration
public readonly SerializedValueView GetValue(string name)
Parameters
Type | Name | Description |
---|---|---|
String | name | The key of the value to get. |
Returns
Type | Description |
---|---|
SerializedValueView | The value associated with the specified key. |
GetValue<T>(T)
Gets the value associated with the specified key.
Declaration
public readonly SerializedValueView GetValue<T>(T name)
where T : struct, INativeList<byte>, IUTF8Bytes
Parameters
Type | Name | Description |
---|---|---|
T | name | The key of the value to get. |
Returns
Type | Description |
---|---|
SerializedValueView | Returns the value associated with the specified key. |
Type Parameters
Name | Description |
---|---|
T | The fixed string type. |
TryGetValue(String, out SerializedValueView)
Gets the value associated with the specified key.
Declaration
public readonly bool TryGetValue(string name, out SerializedValueView value)
Parameters
Type | Name | Description |
---|---|---|
String | name | The key of the value to get. |
SerializedValueView | 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 |
---|---|
Boolean | true if the SerializedMemberViewCollection contains an element with the specified key; otherwise, false. |
TryGetValue<T>(T, out SerializedValueView)
Gets the value associated with the specified key.
Declaration
public readonly bool TryGetValue<T>(T name, out SerializedValueView value)
where T : struct, INativeList<byte>, IUTF8Bytes
Parameters
Type | Name | Description |
---|---|---|
T | name | The key of the value to get. |
SerializedValueView | 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 |
---|---|
Boolean | true if the SerializedObjectView contains an element with the specified key; otherwise, false. |
Type Parameters
Name | Description |
---|---|
T | The fixed string type. |
Explicit Interface Implementations
IEnumerable<SerializedMemberView>.GetEnumerator()
Returns an enumerator that iterates through the SerializedMemberViewCollection.
Declaration
readonly IEnumerator<SerializedMemberView> IEnumerable<SerializedMemberView>.GetEnumerator()
Returns
Type | Description |
---|---|
IEnumerator<SerializedMemberView> | A SerializedMemberViewCollection.Enumerator for the SerializedMemberViewCollection. |
Implements
IEnumerable.GetEnumerator()
Returns an enumerator that iterates through the SerializedMemberViewCollection.
Declaration
readonly IEnumerator IEnumerable.GetEnumerator()
Returns
Type | Description |
---|---|
IEnumerator | A SerializedMemberViewCollection.Enumerator for the SerializedMemberViewCollection. |