• Manual
  • API Documentation
  • Bayat.Json.Utilities
  • CollectionUtils

    Show / Hide Table of Contents
    • Bayat
      • UnityThread
    • Bayat.Core
      • AddReferenceWindow
      • AddReferenceWindow.Dependency
      • AssetReferenceResolver
      • AssetReferenceResolverEditor
      • BayatEditorStyles
      • CoreAssetPostProcessor
      • EditorApplicationUtility
      • MaterialPropertiesResolver
      • MaterialPropertiesResolverEditor
      • ReferenceCheckerWindow
      • ReferenceResolverMode
      • RuntimeMaterialProperties
      • RuntimeMaterialProperty
      • RuntimeMaterialPropertyType
      • SceneReferenceResolver
      • SceneReferenceResolverEditor
      • UnityEditorInternalException
    • Bayat.Core.EditorWindows
      • AssetReferenceManagerWindow
      • AssetReferenceManagerWindow.Styles
      • DatabaseMigrationWindow
      • DatabaseMigrationWindow.SceneMigrationStatus
      • DatabaseMigrationWindow.Styles
      • EditorWindowExtensions
      • EditorWindowUtility
      • EditorWindowWrapper
      • SceneReferenceManagerWindow
      • SceneReferenceManagerWindow.Styles
      • WindowClose
      • WrappedEditorWindow
    • Bayat.Core.Profiling
      • ProfiledSegment
      • ProfiledSegmentCollection
      • ProfilingScope
      • ProfilingUtility
    • Bayat.Core.Reflection
      • AssemblyExtensions
      • Codebase
      • RuntimeCodebase
      • TypeExtensions
      • TypeUtility
    • Bayat.Core.Text
      • StringExtensions
      • StringUtility
    • Bayat.Core.Utilities
      • ExceptionExtensions
      • GuidToReferenceDictionary
      • SerializableDictionary<TKey, TVal>
    • Bayat.Json
      • ConstructorHandling
      • CreateObjectConverterWindow
      • CreateObjectConverterWindow.Styles
      • DateFormatHandling
      • DateParseHandling
      • DateTimeZoneHandling
      • DefaultValueHandling
      • FloatFormatHandling
      • FloatParseHandling
      • Formatting
      • GameObjectSerializationHandler
      • GameObjectSerializationManagerTreeView
      • GameObjectSerializationManagerTreeView.Styles
      • GameObjectSerializationManagerWindow
      • GameObjectSerializationManagerWindow.Styles
      • IArrayPool<T>
      • IJsonLineInfo
      • JsonArrayAttribute
      • JsonConstructorAttribute
      • JsonContainerAttribute
      • JsonContainerType
      • JsonConvert
      • JsonConverter
      • JsonConverterAttribute
      • JsonConverterCollection
      • JsonDefaultSettingsWindow
      • JsonDefaultSettingsWindow.Styles
      • JsonDictionaryAttribute
      • JsonException
      • JsonExtensionDataAttribute
      • JsonIgnoreAttribute
      • JsonObjectAttribute
      • JsonPosition
      • JsonPropertyAttribute
      • JsonReader
      • JsonReader.State
      • JsonReaderException
      • JsonRequiredAttribute
      • JsonSerializationException
      • JsonSerializer
      • JsonSerializerSettings
      • JsonSerializerSettingsPreset
      • JsonTextReader
      • JsonTextWriter
      • JsonToken
      • JsonWriter
      • JsonWriter.State
      • JsonWriterException
      • MemberSerialization
      • MetadataPropertyHandling
      • MissingMemberHandling
      • NullValueHandling
      • ObjectCreationHandling
      • PreserveReferencesHandling
      • ReadType
      • ReferenceLoopHandling
      • Required
      • StringEscapeHandling
      • TypeNameHandling
      • WriteState
    • Bayat.Json.Bson
      • BsonArray
      • BsonBinary
      • BsonBinaryType
      • BsonBinaryWriter
      • BsonObject
      • BsonObjectId
      • BsonProperty
      • BsonReader
      • BsonRegex
      • BsonString
      • BsonToken
      • BsonType
      • BsonValue
      • BsonWriter
    • Bayat.Json.Converters
      • AnimatorConverter
      • AudioClipConverter
      • BinaryConverter
      • BoundsConverter
      • BsonObjectIdConverter
      • ColliderConverter
      • ColorConverter
      • CustomCreationConverter<T>
      • DateTimeConverterBase
      • DiscriminatedUnionConverter
      • EntityKeyMemberConverter
      • ExpandoObjectConverter
      • GameObjectConverter
      • HashSetConverter
      • IsoDateTimeConverter
      • JavaScriptDateTimeConverter
      • KeyValuePairConverter
      • MaterialConverter
      • MaterialConverter.JsonSerializedMaterialProperty
      • Matrix4x4Converter
      • MeshConverter
      • MeshConverter.SerializedIndices
      • MeshFilterConverter
      • ObjectJsonConverter
      • QuaternionConverter
      • RectConverter
      • RectTransformConverter
      • RegexConverter
      • RendererConverter
      • ResolutionConverter
      • ShaderConverter
      • SpriteConverter
      • StringEnumConverter
      • Texture2DConverter
      • TransformConverter
      • UnityBehaviourConverter
      • UnityComponentConverter
      • UnityMonoBehaviourConverter
      • UnityObjectConverter
      • UriConverter
      • VectorConverter
      • VersionConverter
      • XmlNodeConverter
    • Bayat.Json.Linq
      • CommentHandling
      • Extensions
      • IJEnumerable<T>
      • JArray
      • JConstructor
      • JContainer
      • JEnumerable<T>
      • JObject
      • JProperty
      • JPropertyDescriptor
      • JPropertyKeyedCollection
      • JRaw
      • JsonLoadSettings
      • JsonMergeSettings
      • JToken
      • JTokenEqualityComparer
      • JTokenReader
      • JTokenType
      • JTokenWriter
      • JValue
      • LineInfoHandling
      • MergeArrayHandling
      • MergeNullValueHandling
    • Bayat.Json.Linq.JsonPath
      • ArrayIndexFilter
      • ArrayMultipleIndexFilter
      • ArraySliceFilter
      • BooleanQueryExpression
      • CompositeExpression
      • FieldFilter
      • FieldMultipleFilter
      • JPath
      • PathFilter
      • QueryExpression
      • QueryFilter
      • QueryOperator
      • ScanFilter
    • Bayat.Json.Serialization
      • CachedAttributeGetter<T>
      • CamelCasePropertyNamesContractResolver
      • DefaultContractResolver
      • DefaultContractResolver.EnumerableDictionaryWrapper<TEnumeratorKey, TEnumeratorValue>
      • DefaultContractResolverState
      • DefaultReferenceResolver
      • DefaultSerializationBinder
      • DefaultSerializationBinder.TypeNameKey
      • DiagnosticsTraceWriter
      • ErrorContext
      • ErrorEventArgs
      • ExpressionValueProvider
      • ExtensionDataGetter
      • ExtensionDataSetter
      • IAttributeProvider
      • IContractResolver
      • IReferenceResolver
      • ITraceWriter
      • IValueProvider
      • JsonArrayContract
      • JsonContainerContract
      • JsonContract
      • JsonContractType
      • JsonDictionaryContract
      • JsonDynamicContract
      • JsonFormatterConverter
      • JsonISerializableContract
      • JsonLinqContract
      • JsonObjectContract
      • JsonPrimitiveContract
      • JsonProperty
      • JsonPropertyCollection
      • JsonSerializerInternalBase
      • JsonSerializerProxy
      • JsonSerializerReader
      • JsonSerializerReader.CreatorPropertyContext
      • JsonSerializerReader.PropertyPresence
      • JsonSerializerWriter
      • JsonStringContract
      • JsonTypeReflector
      • MemoryTraceWriter
      • ObjectConstructor<T>
      • OnErrorAttribute
      • ReflectionAttributeProvider
      • ReflectionValueProvider
      • ResolverContractKey
      • SerializationCallback
      • SerializationErrorCallback
      • TraceJsonReader
      • TraceJsonWriter
    • Bayat.Json.Shims
      • PreserveAttribute
    • Bayat.Json.Utilities
      • Base64Encoder
      • BidirectionalDictionary<TFirst, TSecond>
      • BufferUtils
      • CollectionUtils
      • CollectionWrapper<T>
      • ConvertUtils
      • ConvertUtils.ConvertResult
      • ConvertUtils.TypeConvertKey
      • Creator<T>
      • DateTimeParser
      • DateTimeUtils
      • DictionaryWrapper<TKey, TValue>
      • DynamicProxy<T>
      • DynamicProxyMetaObject<T>
      • DynamicUtils
      • DynamicUtils.BinderWrapper
      • EnumUtils
      • EnumValue<T>
      • ExpressionReflectionDelegateFactory
      • FSharpFunction
      • FSharpUtils
      • ImmutableCollectionsUtils
      • ImmutableCollectionsUtils.ImmutableCollectionTypeInfo
      • IWrappedCollection
      • IWrappedDictionary
      • JavaScriptUtils
      • JsonTokenUtils
      • LateBoundReflectionDelegateFactory
      • MathUtils
      • MethodCall<T, TResult>
      • MiscellaneousUtils
      • NoThrowExpressionVisitor
      • NoThrowGetBinderMember
      • NoThrowSetBinderMember
      • ParseResult
      • ParserTimeZone
      • PrimitiveTypeCode
      • PropertyNameTable
      • ReflectionDelegateFactory
      • ReflectionMember
      • ReflectionObject
      • ReflectionUtils
      • StringBuffer
      • StringReference
      • StringReferenceExtensions
      • StringUtils
      • ThreadSafeStore<TKey, TValue>
      • TypeInformation
      • ValidationUtils
    • Bayat.SaveSystem
      • AutoSave
      • AutoSaveManager
      • AutoSaveManager.LoadEvent
      • AutoSaveManager.SaveEvent
      • AutoSaveManagerWindow
      • AutoSaveManagerWindow.Styles
      • LoadEventArgs
      • LoadIntoEventArgs
      • SaveEventArgs
      • SaveSystemAPI
      • SaveSystemDefaultSettingsWindow
      • SaveSystemDefaultSettingsWindow.Styles
      • SaveSystemEditorResources
      • SaveSystemJsonSerializer
      • SaveSystemManager
      • SaveSystemSettings
      • SaveSystemSettingsPreset
      • WelcomeWindow
      • WelcomeWindow.Styles
    • Bayat.SaveSystem.Security
      • ISaveSystemEncryption
      • SaveSystemCryptoStream
      • SaveSystemSymmetricCryptoStream
      • SaveSystemSymmetricEncryption
    • Bayat.SaveSystem.Storage
      • BuiltInConnectionFactory
      • ConnectionStringFactory
      • FileStorageStream
      • IConnectionFactory
      • IStorage
      • IStorageStream
      • LocalDiskStorage
      • PlayerPrefsStorage
      • PlayerPrefsStorageStream
      • StorageBackup
      • StorageBase
      • StorageClearOperationResult
      • StorageConnectionString
      • StorageCopyOperationResult
      • StorageDeleteOperationResult
      • StorageFactory
      • StorageFullException
      • StorageInvalidIdentifierException
      • StorageItemNotFoundException
      • StorageListOptions
      • StorageMetaData
      • StorageMoveOperationResult
      • StorageOperationResult
      • StorageStream

    Class CollectionUtils

    Inheritance
    System.Object
    CollectionUtils
    Inherited Members
    System.Object.Equals(System.Object)
    System.Object.Equals(System.Object, System.Object)
    System.Object.GetHashCode()
    System.Object.GetType()
    System.Object.MemberwiseClone()
    System.Object.ReferenceEquals(System.Object, System.Object)
    System.Object.ToString()
    Namespace: Bayat.Json.Utilities
    Assembly: Bayat.Json.Runtime.dll
    Syntax
    public static class CollectionUtils

    Methods

    | Improve this Doc View Source

    AddDistinct<T>(IList<T>, T)

    Declaration
    public static bool AddDistinct<T>(this IList<T> list, T value)
    Parameters
    Type Name Description
    System.Collections.Generic.IList<T> list
    T value
    Returns
    Type Description
    System.Boolean
    Type Parameters
    Name Description
    T
    | Improve this Doc View Source

    AddDistinct<T>(IList<T>, T, IEqualityComparer<T>)

    Declaration
    public static bool AddDistinct<T>(this IList<T> list, T value, IEqualityComparer<T> comparer)
    Parameters
    Type Name Description
    System.Collections.Generic.IList<T> list
    T value
    System.Collections.Generic.IEqualityComparer<T> comparer
    Returns
    Type Description
    System.Boolean
    Type Parameters
    Name Description
    T
    | Improve this Doc View Source

    AddRange<T>(IList<T>, IEnumerable<T>)

    Adds the elements of the specified collection to the specified generic IList.

    Declaration
    public static void AddRange<T>(this IList<T> initial, IEnumerable<T> collection)
    Parameters
    Type Name Description
    System.Collections.Generic.IList<T> initial

    The list to add to.

    System.Collections.Generic.IEnumerable<T> collection

    The collection of elements to add.

    Type Parameters
    Name Description
    T
    | Improve this Doc View Source

    AddRangeDistinct<T>(IList<T>, IEnumerable<T>, IEqualityComparer<T>)

    Declaration
    public static bool AddRangeDistinct<T>(this IList<T> list, IEnumerable<T> values, IEqualityComparer<T> comparer)
    Parameters
    Type Name Description
    System.Collections.Generic.IList<T> list
    System.Collections.Generic.IEnumerable<T> values
    System.Collections.Generic.IEqualityComparer<T> comparer
    Returns
    Type Description
    System.Boolean
    Type Parameters
    Name Description
    T
    | Improve this Doc View Source

    Contains<T>(List<T>, T, IEqualityComparer)

    Declaration
    public static bool Contains<T>(this List<T> list, T value, IEqualityComparer comparer)
    Parameters
    Type Name Description
    System.Collections.Generic.List<T> list
    T value
    System.Collections.IEqualityComparer comparer
    Returns
    Type Description
    System.Boolean
    Type Parameters
    Name Description
    T
    | Improve this Doc View Source

    ContainsValue<TSource>(IEnumerable<TSource>, TSource, IEqualityComparer<TSource>)

    Declaration
    public static bool ContainsValue<TSource>(this IEnumerable<TSource> source, TSource value, IEqualityComparer<TSource> comparer)
    Parameters
    Type Name Description
    System.Collections.Generic.IEnumerable<TSource> source
    TSource value
    System.Collections.Generic.IEqualityComparer<TSource> comparer
    Returns
    Type Description
    System.Boolean
    Type Parameters
    Name Description
    TSource
    | Improve this Doc View Source

    IndexOf<T>(IEnumerable<T>, Func<T, Boolean>)

    Declaration
    public static int IndexOf<T>(this IEnumerable<T> collection, Func<T, bool> predicate)
    Parameters
    Type Name Description
    System.Collections.Generic.IEnumerable<T> collection
    System.Func<T, System.Boolean> predicate
    Returns
    Type Description
    System.Int32
    Type Parameters
    Name Description
    T
    | Improve this Doc View Source

    IndexOfReference<T>(List<T>, T)

    Declaration
    public static int IndexOfReference<T>(this List<T> list, T item)
    Parameters
    Type Name Description
    System.Collections.Generic.List<T> list
    T item
    Returns
    Type Description
    System.Int32
    Type Parameters
    Name Description
    T
    | Improve this Doc View Source

    IsDictionaryType(Type)

    Declaration
    public static bool IsDictionaryType(Type type)
    Parameters
    Type Name Description
    System.Type type
    Returns
    Type Description
    System.Boolean
    | Improve this Doc View Source

    IsNullOrEmpty<T>(ICollection<T>)

    Determines whether the collection is null or empty.

    Declaration
    public static bool IsNullOrEmpty<T>(ICollection<T> collection)
    Parameters
    Type Name Description
    System.Collections.Generic.ICollection<T> collection

    The collection.

    Returns
    Type Description
    System.Boolean

    true if the collection is null or empty; otherwise, false.

    Type Parameters
    Name Description
    T
    | Improve this Doc View Source

    ResolveEnumerableCollectionConstructor(Type, Type)

    Declaration
    public static ConstructorInfo ResolveEnumerableCollectionConstructor(Type collectionType, Type collectionItemType)
    Parameters
    Type Name Description
    System.Type collectionType
    System.Type collectionItemType
    Returns
    Type Description
    System.Reflection.ConstructorInfo
    | Improve this Doc View Source

    ResolveEnumerableCollectionConstructor(Type, Type, Type)

    Declaration
    public static ConstructorInfo ResolveEnumerableCollectionConstructor(Type collectionType, Type collectionItemType, Type constructorArgumentType)
    Parameters
    Type Name Description
    System.Type collectionType
    System.Type collectionItemType
    System.Type constructorArgumentType
    Returns
    Type Description
    System.Reflection.ConstructorInfo
    | Improve this Doc View Source

    ToMultidimensionalArray(IList, Type, Int32)

    Declaration
    public static Array ToMultidimensionalArray(IList values, Type type, int rank)
    Parameters
    Type Name Description
    System.Collections.IList values
    System.Type type
    System.Int32 rank
    Returns
    Type Description
    System.Array
    • Improve this Doc
    • View Source
    • 0 Comments
    In This Article
    • Methods
      • AddDistinct<T>(IList<T>, T)
      • AddDistinct<T>(IList<T>, T, IEqualityComparer<T>)
      • AddRange<T>(IList<T>, IEnumerable<T>)
      • AddRangeDistinct<T>(IList<T>, IEnumerable<T>, IEqualityComparer<T>)
      • Contains<T>(List<T>, T, IEqualityComparer)
      • ContainsValue<TSource>(IEnumerable<TSource>, TSource, IEqualityComparer<TSource>)
      • IndexOf<T>(IEnumerable<T>, Func<T, Boolean>)
      • IndexOfReference<T>(List<T>, T)
      • IsDictionaryType(Type)
      • IsNullOrEmpty<T>(ICollection<T>)
      • ResolveEnumerableCollectionConstructor(Type, Type)
      • ResolveEnumerableCollectionConstructor(Type, Type, Type)
      • ToMultidimensionalArray(IList, Type, Int32)