Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Criteria<E>

Provides create criteria on object[] data.

Type parameters

  • E

Hierarchy

Index

Constructors

constructor

Properties

Private _limit

_limit: number

Holds to retrieve a fixed number maxResults of objects from the given data.

type

{number}

Private _offset

_offset: number

Holds an integer that represents the first row in your result set, starting with row 0.

type

{number}

Private dataList

dataList: E[]

Holds given original data list which criteria work on.

Private restrictionMap

restrictionMap: Props<RestrictionItem>

Holds added restrictions to constrain the results to be retrieved.

type

{Array}

Private sortMap

sortMap: Props<OrderCallback<E>>

Holds given orders to ordering the result set.

type

{Array}

Accessors

limit

  • get limit(): number

offset

  • get offset(): number

total

  • get total(): number

Methods

add

addOrder

asc

between

  • between(name: string, leftValue: any, rightValue: any): Criteria<E>

bindAll

  • bindAll(instance: Object): void

clear

clearOrder

clearRestriction

desc

endsWith

  • endsWith(name: string, value: any, caseSensitive?: boolean): Criteria<E>

eq

  • eq(name: string, value: any, caseSensitive?: boolean): Criteria<E>

gt

  • gt(name: string, value: any): Criteria<E>

gte

  • gte(name: string, value: any): Criteria<E>

in

  • in(name: string, values: any[], caseSensitive?: boolean): Criteria<E>

Private init

  • init(): void

isFalse

isNotNull

isNull

isTrue

like

  • like(name: string, value: any, caseSensitive?: boolean): Criteria<E>

likeIn

  • likeIn(name: string, values: any[], caseSensitive?: boolean): Criteria<E>

list

lt

  • lt(name: string, value: any): Criteria<E>

lte

  • lte(name: string, value: any): Criteria<E>

neq

  • neq(name: string, value: any, caseSensitive?: boolean): Criteria<E>

query

  • query(value: any, ignoreList?: string[]): Criteria<E>

removeOrder

removeRestriction

  • removeRestriction(name: string, op: string): Criteria<E>

removeRestrictionByIndex

  • removeRestrictionByIndex(index: string): Criteria<E>

removeRestrictionByName

  • removeRestrictionByName(name: string): Criteria<E>

setLimit

  • This method tells Criteria to retrieve a fixed number maxResults of objects.

    Parameters

    • limit: number

    Returns Criteria<E>

setOffset

  • setOffset(firstResult: number): Criteria<E>
  • This method takes an integer that represents the first row in your result set, starting with row 0.

    Parameters

    • firstResult: number

    Returns Criteria<E>

sort

startsWith

  • startsWith(name: string, value: any, caseSensitive?: boolean): Criteria<E>

Static bindAll

  • bindAll(instance: Props<any>): void
  • Binds all methods to the instance.

    Parameters

    • instance: Props<any>

      to bind

    Returns void

Static Private filter

  • filter<E>(instance: Criteria<E>, item: any): boolean

Static Private has

  • has(props: Props<any>): boolean

Static Private indexOfRestriction

  • indexOfRestriction(name: string, op: string): string

Static list

Generated using TypeDoc