Show / Hide Table of Contents

    Class Equatable

    A set of utilities uses for easily wrapping .NET collections so they can be used with , and behavior similar to that in Java. The equality checking of collections will recursively compare the values of all elements and any nested collections. The same goes for using - the string is based on the values in the collection and any nested collections.

    Do note this has a side-effect that any custom , and implementations for types that implement (including arrays), , or will be ignored.

    Inheritance
    System.Object
    Equatable
    Namespace: Lucene.Net.Support
    Assembly: Lucene.Net.dll
    Syntax
    public static class Equatable : object

    Methods

    | Improve this Doc View Source

    Wrap<T>(IList<T>)

    Wraps any (including T[]) with a lightweight EquatableList<T> class that changes the behavior of , and so they consider all values in the or any nested collections when comparing or making strings to represent them. No other behavior is changed - only these 3 methods.

    Note that if the list is already an EquatableList<T> or a subclass of it, this method simply returns the provided list.

    Declaration
    public static IList<T> Wrap<T>(IList<T> list)
    Parameters
    Type Name Description
    IList<T> list

    Any (including T[])

    Returns
    Type Description
    IList<T>

    An EquatableList<T> that wraps the provided list, or the value of list unmodified if it already is an EquatableList<T>

    Type Parameters
    Name Description
    T

    the type of element

    | Improve this Doc View Source

    Wrap<T>(ISet<T>)

    Wraps any with a lightweight EquatableSet<T> class that changes the behavior of , and so they consider all values in the or any nested collections when comparing or making strings to represent them. No other behavior is changed - only these 3 methods.

    Note that if the set is already an EquatableSet<T> or a subclass of it, this method simply returns the provided set.

    Declaration
    public static ISet<T> Wrap<T>(ISet<T> set)
    Parameters
    Type Name Description
    ISet<T> set

    Any (including T[])

    Returns
    Type Description
    ISet<T>

    An EquatableSet<T> that wraps the provided set, or the value of set unmodified if it already is an EquatableSet<T>

    Type Parameters
    Name Description
    T

    the type of element

    • Improve this Doc
    • View Source
    Back to top Copyright © 2020 Licensed to the Apache Software Foundation (ASF)