Skip to content

Commit cf7131d

Browse files
committed
adds missing documentation to map methods
1 parent 9bb4021 commit cf7131d

File tree

1 file changed

+18
-18
lines changed

1 file changed

+18
-18
lines changed

src/IMap.ts

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@ export interface IMap<K, V> extends DistributedObject {
77
/**
88
* This method checks whether the map has an item asssociated with key
99
* @param key
10-
* @throws {Error} if key is undefined or null
10+
* @throws {@link Error} if key is undefined or null
1111
* @return a promise to be resolved to true if the map contains the key, false otherwise.
1212
*/
1313
containsKey(key: K) : Q.Promise<boolean>;
1414

1515
/**
1616
* This method return true if this map has key(s) associated with given value
17-
* @throws {Error} if value is undefined or null
17+
* @throws {@link Error} if value is undefined or null
1818
* @param value
1919
* @return a promise to be resolved to true if the map has key or keys associated with given value.
2020
*/
@@ -29,7 +29,7 @@ export interface IMap<K, V> extends DistributedObject {
2929
* @param ttl Time to live in seconds. 0 means infinite.
3030
* If ttl is not an integer, it is rounded up to the nearest integer value.
3131
* @throws {Error} if specified key or value is undefined or null or ttl is negative.
32-
* @return a promise to be resolved to the old value if there was any, undefined otherwise.
32+
* @return a promise to be resolved to the old value if there was any, `undefined` otherwise.
3333
*/
3434
put(key: K, value: V, ttl?: number) : Q.Promise<V>;
3535

@@ -60,7 +60,7 @@ export interface IMap<K, V> extends DistributedObject {
6060
* @param key
6161
* @param value
6262
* @throws {Error} if key is undefined or null
63-
* @return a promise to be resolved to the value associated with key, undefined if the key did not exist before.
63+
* @return a promise to be resolved to the value associated with key, `undefined` if the key did not exist before.
6464
*/
6565
remove(key: K, value?: V) : Q.Promise<V>;
6666

@@ -130,7 +130,7 @@ export interface IMap<K, V> extends DistributedObject {
130130
* When this client puts the non-existent key, it is allowed to do that.
131131
* Locks are re-entrant meaning that if lock is taken N times, it should be released N times.
132132
* @param key
133-
* @param ttl lock is automatically unlocked after ttl milliseconds
133+
* @param ttl lock is automatically unlocked after `ttl` milliseconds.
134134
*/
135135
lock(key: K, ttl?: number): Q.Promise<void>;
136136

@@ -142,29 +142,29 @@ export interface IMap<K, V> extends DistributedObject {
142142
/**
143143
* Loads keys to the store.
144144
* @param keys loads only given keys if set.
145-
* @param replaceExistingValues if {true} existing keys will be replaced by newly loaded keys.
145+
* @param replaceExistingValues if `true` existing keys will be replaced by newly loaded keys.
146146
*/
147147
loadAll(keys?: K[], replaceExistingValues?: boolean): Q.Promise<void>;
148148

149149
/**
150150
* Puts specified key value association if it was not present before.
151151
* @param key
152152
* @param value
153-
* @param ttl if set, key will be evicted automatically after ttl milliseconds.
153+
* @param ttl if set, key will be evicted automatically after `ttl` milliseconds.
154154
* @return old value of the entry.
155155
*/
156156
putIfAbsent(key: K, value: V, ttl?: number): Q.Promise<V>;
157157

158158
/**
159-
* Same as {@link #put} except it does not call underlying MapStore.
159+
* Same as {@link put} except it does not call underlying MapStore.
160160
* @param key
161161
* @param value
162162
* @param ttl
163163
*/
164164
putTransient(key: K, value: V, ttl?: number): Q.Promise<void>;
165165

166166
/**
167-
* Replaces value of the key if only it was associated to oldValue.
167+
* Replaces value of the key if only it was associated to `oldValue`.
168168
* @param key
169169
* @param value
170170
* @param oldValue
@@ -173,15 +173,15 @@ export interface IMap<K, V> extends DistributedObject {
173173
replaceIfSame(key: K, oldValue: V, newValue: V): Q.Promise<boolean>;
174174

175175
/**
176-
* Replaces value of given key with newValue.
176+
* Replaces value of given key with `newValue`.
177177
* @param key
178178
* @param newValue
179179
* @return previous value
180180
*/
181181
replace(key: K, newValue: V): Q.Promise<V>;
182182

183183
/**
184-
* Similar to {@link #put} except it does not return the old value.
184+
* Similar to {@link put} except it does not return the old value.
185185
* @param key
186186
* @param value
187187
* @param ttl
@@ -219,15 +219,15 @@ export interface IMap<K, V> extends DistributedObject {
219219
* Tries to acquire the lock for the specified key.
220220
* If lock is not available, server immediately responds with {false}
221221
* @param key
222-
* @param timeout Server waits for timeout seconds to acquire the lock before giving up.
223-
* @param lease lock is automatically release after leases milliseconds.
222+
* @param timeout Server waits for `timeout` seconds to acquire the lock before giving up.
223+
* @param lease lock is automatically release after `lease` milliseconds.
224224
*/
225225
tryLock(key: K, timeout?: number, lease?: number): Q.Promise<boolean>;
226226

227227
/**
228228
* Tries to put specified key value pair into map. If this method returns
229229
* false, it indicates that caller thread was not able to acquire the lock for
230-
* given key in {timeout} seconds.
230+
* given key in `timeout` seconds.
231231
* @param key
232232
* @param value
233233
* @param timeout
@@ -237,14 +237,14 @@ export interface IMap<K, V> extends DistributedObject {
237237
/**
238238
* Tries to remove specified key from map. If this method returns
239239
* false, it indicates that caller thread was not able to acquire the lock for
240-
* given key in {timeout} seconds.
240+
* given key in `timeout` seconds.
241241
* @param key
242242
* @param timeout
243243
*/
244244
tryRemove(key: K, timeout: number): Q.Promise<boolean>;
245245

246246
/**
247-
* Adds a {@link MapListener} for this map.
247+
* Adds a {@link IMapListener} for this map.
248248
* @param listener
249249
* @param key Events are triggered for only this key if set.
250250
* @param includeValue Event message contains new value of the key if set to {true}.
@@ -253,9 +253,9 @@ export interface IMap<K, V> extends DistributedObject {
253253
addEntryListener(listener: IMapListener<K, V>, key?: K, includeValue?: boolean): Q.Promise<string>;
254254

255255
/**
256-
* Removes a {@link MapListener} from this map.
256+
* Removes a {@link IMapListener} from this map.
257257
* @param listenerId Registration Id of the listener.
258-
* @return {true} if remove operation is successful, {false} if unsuccessful or this listener did not exist.
258+
* @return `true` if remove operation is successful, `false` if unsuccessful or this listener did not exist.
259259
*/
260260
removeEntryListener(listenerId: string): Q.Promise<boolean>;
261261
}

0 commit comments

Comments
 (0)