Package org.redisson.api
Interface RIdGenerator
-
- All Superinterfaces:
RExpirable
,RExpirableAsync
,RIdGeneratorAsync
,RObject
,RObjectAsync
- All Known Implementing Classes:
RedissonIdGenerator
public interface RIdGenerator extends RExpirable, RIdGeneratorAsync
Id generator ofLong
type numbers. Returns unique numbers but not monotonically increased.- Author:
- Nikita Koksharov
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description long
nextId()
Returns next unique number but not monotonically increasedboolean
tryInit(long value, long allocationSize)
Initializes Id generator params.-
Methods inherited from interface org.redisson.api.RExpirable
clearExpire, expire, expire, expireAt, expireAt, remainTimeToLive
-
Methods inherited from interface org.redisson.api.RExpirableAsync
clearExpireAsync, expireAsync, expireAsync, expireAtAsync, expireAtAsync, remainTimeToLiveAsync
-
Methods inherited from interface org.redisson.api.RIdGeneratorAsync
nextIdAsync, tryInitAsync
-
Methods inherited from interface org.redisson.api.RObject
addListener, copy, delete, dump, getCodec, getIdleTime, getName, isExists, migrate, move, removeListener, rename, renamenx, restore, restore, restoreAndReplace, restoreAndReplace, sizeInMemory, touch, unlink
-
Methods inherited from interface org.redisson.api.RObjectAsync
addListenerAsync, copyAsync, deleteAsync, dumpAsync, getIdleTimeAsync, isExistsAsync, migrateAsync, moveAsync, removeListenerAsync, renameAsync, renamenxAsync, restoreAndReplaceAsync, restoreAndReplaceAsync, restoreAsync, restoreAsync, sizeInMemoryAsync, touchAsync, unlinkAsync
-
-
-
-
Method Detail
-
tryInit
boolean tryInit(long value, long allocationSize)
Initializes Id generator params.- Parameters:
value
- - initial valueallocationSize
- - values range allocation size- Returns:
true
if Id generator initializedfalse
if Id generator already initialized
-
nextId
long nextId()
Returns next unique number but not monotonically increased- Returns:
- number
-
-