Skip to main content
Version: 2.0

RelatedTo

Specific predicate class creator for filtering based on relations between objects

A path is defined by a list of relations, and an object match the predicate if and only if the patch can be followed to a destination (which might be specified)

Hierarchy

Index

Constructors

constructor

  • Parameters

    • optionaldestination: Tag

    Returns RelatedTo

Methods

follow

  • Adds a relation to the path the RelatedTo predicate must match


    Parameters

    • relation: Relation<any, any>

      relation to add to the path

    Returns RelatedTo

    new RelatedTo predicate with additional relation to match in the path

followRecursive

  • Adds a relation that can be followed recursively in the path for the RelatedTo predicate


    Parameters

    • relation: Relation<any, any>

      relation to add to the path that can be followed recursively

    Returns RelatedTo

    new RelatedTo predicate with additional relation that can be matched recursively in the path

staticand

  • Create an AND composite predicate matching a specified set of predicates


    Parameters

    • rest...predicates: Predicate[]

      list of predicates to match

    Returns Predicate

    new Predicate that should match all specified predicates

staticcontains

  • contains(property: Property<string>, value: string, caseSensitive?: boolean): Predicate
  • Create a predicate matching a specified string property to a specified string.


    Parameters

    • property: Property<string>

      the string property to use for filtering

    • value: string

      the value the string property must match

    • optionalcaseSensitive: boolean

      if the match must pay attention to case sensitivity

    Returns Predicate

    new Predicate with the contains string operation

staticequals

  • Create a predicate matching a specified property to a specified value.


    Type parameters

    • T

    Parameters

    • property: Property<T>

      the property to use for filtering

    • value: T

      the value the property must match

    Returns Predicate

    new Predicate with the equals operation

staticgreaterThan

  • Create a predicate matching a specified number property to a numerical lower bound


    Parameters

    • property: Property<number>

      the number property to user for filtering

    • value: number

      the lower bound

    • optionalstrict: boolean

      if the inequality is strict or not

    Returns Predicate

    new Predicate with the greaterThan mathematical operation

staticnot

  • Create a NOT predicate matching the opposite of a specified predicate


    Parameters

    Returns Predicate

    new Predicate that match when the specified predicate does not

staticor

  • Create an OR composite predicate matching a specified set of predicates


    Parameters

    • rest...predicates: Predicate[]

      list of predicates to match

    Returns Predicate

    new Predicate that should match at least one specified predicate

staticregex

  • Create a predicate matching a specified string property to a regular expression.


    Parameters

    • property: Property<string>

      the string property to use for filtering

    • value: RegExp

      the regex the string property must match

    • optionalcaseSensitive: boolean

      if the match must pay attention to case sensitivity

    Returns Predicate

    new Predicate with the match regex operation

staticsmallerThan

  • Create a predicate matching a specified number property to a numerical upper bound


    Parameters

    • property: Property<number>

      the number property to user for filtering

    • value: number

      the upper bound

    • optionalstrict: boolean

      if the inequality is strict or not

    Returns Predicate

    new Predicate with the smallerThan mathematical operation