/
antjs-search-options.ts
50 lines (44 loc) · 1.19 KB
/
antjs-search-options.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
import { AntJsDeleteOptions } from './antjs-delete-options';
import { AntJsUpdateOptions } from './antjs-update-options';
import { CacheMode } from './cache-mode';
import { PersistencySearchOptions } from './persistency-search-options';
export class AntJsSearchOptions implements PersistencySearchOptions {
/**
* True if negative cache must be used.
*/
protected _deleteOptions: AntJsDeleteOptions;
/**
* Update options.
*/
protected _updateOptions: AntJsUpdateOptions;
/**
* Creates a new persistency search options.
* @param deleteOptions Delete options.
* @param updateOptions Update options.
*/
public constructor(
deleteOptions: AntJsDeleteOptions = new AntJsDeleteOptions(),
updateOptions: AntJsUpdateOptions = new AntJsUpdateOptions(),
) {
this._deleteOptions = deleteOptions;
this._updateOptions = updateOptions;
}
/**
* @inheritdoc
*/
public get negativeCache(): boolean {
return this._deleteOptions.negativeCache;
}
/**
* @inheritdoc
*/
public get cacheMode(): CacheMode {
return this._updateOptions.cacheMode;
}
/**
* @inheritdoc
*/
public get ttl(): number {
return this._updateOptions.ttl;
}
}