Class ImmutableValueList<T>
- Namespace
- GuildWars2.Collections
- Assembly
- GuildWars2.dll
Represents an immutable list collection with value semantics, meaning two ImmutableValueList<T> instances are considered equal if their contents are equal.
[JsonConverter(typeof(ImmutableValueListJsonConverter))]
[SuppressMessage("Style", "IDE0028", Justification = "Cannot simplify constructor calls that wrap ImmutableList<T>.")]
[SuppressMessage("Style", "IDE0301", Justification = "Cannot simplify to collection expression.")]
[SuppressMessage("Style", "IDE0303", Justification = "Cannot simplify to collection expression.")]
public sealed class ImmutableValueList<T> : IImmutableValueList<T>, IImmutableList<T>, IReadOnlyList<T>, IReadOnlyCollection<T>, IEnumerable<T>, IEnumerable, IEquatable<IImmutableValueList<T>>
Type Parameters
TThe type of elements in the list.
- Inheritance
-
ImmutableValueList<T>
- Implements
-
IEnumerable<T>
- Inherited Members
Constructors
- ImmutableValueList()
Initializes a new instance of the ImmutableValueList<T> class that is empty.
- ImmutableValueList(IEnumerable<T>)
Initializes a new instance of the ImmutableValueList<T> class that contains elements copied from the specified collection.
Properties
- Empty
Gets an empty ImmutableValueList<T>.
Methods
- Add(T)
Creates a new ImmutableValueList<T> with the specified item added to the end.
- AddRange(IEnumerable<T>)
Creates a new ImmutableValueList<T> with the specified items added to the end.
- Clear()
Creates a new ImmutableValueList<T> with all items removed.
- Create(ReadOnlySpan<T>)
Creates an ImmutableValueList<T> from a span of values. Used by collection expressions.
- Equals(IImmutableValueList<T>?)
Determines whether the current ImmutableValueList<T> is equal to another IImmutableValueList<T> based on value semantics.
- GetHashCode()
Returns a hash code based on the values of the items in the list.
- IndexOf(T, int, int, IEqualityComparer<T>?)
Searches for the specified item and returns the zero-based index of the first occurrence within the range of elements that starts at the specified index and contains the specified number of elements.
- Insert(int, T)
Creates a new ImmutableValueList<T> with the specified item inserted at the specified index.
- InsertRange(int, IEnumerable<T>)
Creates a new ImmutableValueList<T> with the specified items inserted at the specified index.
- LastIndexOf(T, int, int, IEqualityComparer<T>?)
Searches for the specified item and returns the zero-based index of the last occurrence within the range of elements that contains the specified number of elements and ends at the specified index.
- Remove(T, IEqualityComparer<T>?)
Creates a new ImmutableValueList<T> with the first occurrence of the specified item removed.
- RemoveAll(Predicate<T>)
Creates a new ImmutableValueList<T> with all elements that match the conditions defined by the specified predicate removed.
- RemoveAt(int)
Creates a new ImmutableValueList<T> with the item at the specified index removed.
- RemoveRange(IEnumerable<T>, IEqualityComparer<T>?)
Creates a new ImmutableValueList<T> with the specified items removed.
- RemoveRange(int, int)
Creates a new ImmutableValueList<T> with a range of elements removed.
- Replace(T, T, IEqualityComparer<T>?)
Creates a new ImmutableValueList<T> with the first occurrence of the specified value replaced with a new value.
- SetItem(int, T)
Creates a new ImmutableValueList<T> with the element at the specified index replaced.
Operators
- operator ==(ImmutableValueList<T>?, ImmutableValueList<T>?)
Determines whether two ImmutableValueList<T> instances are equal by value.
- operator !=(ImmutableValueList<T>?, ImmutableValueList<T>?)
Determines whether two ImmutableValueList<T> instances are not equal by value.