public abstract class RedissonObject extends Object implements RObject
| Modifier and Type | Field and Description |
|---|---|
protected Codec |
codec |
protected CommandAsyncExecutor |
commandExecutor |
| Constructor and Description |
|---|
RedissonObject(Codec codec,
CommandAsyncExecutor commandExecutor,
String name) |
RedissonObject(CommandAsyncExecutor commandExecutor,
String name) |
| Modifier and Type | Method and Description |
|---|---|
protected boolean |
await(RFuture<?> future,
long timeout,
TimeUnit timeoutUnit) |
boolean |
delete()
Deletes the object
|
RFuture<Boolean> |
deleteAsync()
Delete object in async mode
|
protected byte[] |
encode(Object value) |
protected byte[] |
encodeMapKey(Object value) |
protected byte[] |
encodeMapValue(Object value) |
protected <V> V |
get(RFuture<V> future) |
Codec |
getCodec()
Returns the underlying Codec used by this RObject
|
String |
getName()
Returns name of object
|
protected String |
getName(Object o) |
boolean |
isExists()
Check object existence
|
RFuture<Boolean> |
isExistsAsync()
Check object existence in async mode.
|
void |
migrate(String host,
int port,
int database)
Transfer an object from source Redis instance to destination Redis instance
|
RFuture<Void> |
migrateAsync(String host,
int port,
int database)
Transfer an object from source Redis instance to destination Redis instance
in async mode
|
boolean |
move(int database)
Move object to another database
|
RFuture<Boolean> |
moveAsync(int database)
Move object to another database in async mode
|
protected <V> RPromise<V> |
newPromise() |
protected <V> RFuture<V> |
newSucceededFuture(V result) |
protected String |
prefixName(String prefix,
String name) |
void |
rename(String newName)
Rename current object key to
newName |
RFuture<Void> |
renameAsync(String newName)
Rename current object key to
newName
in async mode |
boolean |
renamenx(String newName)
Rename current object key to
newName
only if new key is not exists |
RFuture<Boolean> |
renamenxAsync(String newName)
Rename current object key to
newName
in async mode only if new key is not exists |
protected String |
suffixName(String name,
String suffix) |
boolean |
touch()
Update the last access time of an object.
|
RFuture<Boolean> |
touchAsync()
Update the last access time of an object in async mode.
|
boolean |
unlink()
Delete the objects.
|
RFuture<Boolean> |
unlinkAsync()
Delete the objects.
|
protected final CommandAsyncExecutor commandExecutor
protected final Codec codec
public RedissonObject(Codec codec, CommandAsyncExecutor commandExecutor, String name)
public RedissonObject(CommandAsyncExecutor commandExecutor, String name)
protected boolean await(RFuture<?> future, long timeout, TimeUnit timeoutUnit) throws InterruptedException
InterruptedExceptionprotected <V> V get(RFuture<V> future)
protected <V> RPromise<V> newPromise()
protected <V> RFuture<V> newSucceededFuture(V result)
public void rename(String newName)
RObjectnewNamepublic RFuture<Void> renameAsync(String newName)
RObjectAsyncnewName
in async moderenameAsync in interface RObjectAsyncnewName - - new name of objectpublic void migrate(String host, int port, int database)
RObjectpublic RFuture<Void> migrateAsync(String host, int port, int database)
RObjectAsyncmigrateAsync in interface RObjectAsynchost - - destination hostport - - destination portdatabase - - destination databasepublic boolean move(int database)
RObjectpublic RFuture<Boolean> moveAsync(int database)
RObjectAsyncmoveAsync in interface RObjectAsyncdatabase - - number of Redis databasetrue if key was moved false if notpublic boolean renamenx(String newName)
RObjectnewName
only if new key is not existspublic RFuture<Boolean> renamenxAsync(String newName)
RObjectAsyncnewName
in async mode only if new key is not existsrenamenxAsync in interface RObjectAsyncnewName - - new name of objecttrue if object has been renamed successfully and false otherwisepublic boolean delete()
RObjectpublic RFuture<Boolean> deleteAsync()
RObjectAsyncdeleteAsync in interface RObjectAsynctrue if object was deleted false if notpublic boolean unlink()
RObjectRequires Redis 4.0+
public RFuture<Boolean> unlinkAsync()
RObjectAsyncRequires Redis 4.0+
unlinkAsync in interface RObjectAsynctrue if it was exist and deleted else falsepublic boolean touch()
RObjectpublic RFuture<Boolean> touchAsync()
RObjectAsynctouchAsync in interface RObjectAsynctrue if object was touched else falsepublic boolean isExists()
RObjectpublic RFuture<Boolean> isExistsAsync()
RObjectAsyncisExistsAsync in interface RObjectAsynctrue if object exists and false otherwisepublic Codec getCodec()
RObjectprotected byte[] encode(Object value)
protected byte[] encodeMapKey(Object value)
protected byte[] encodeMapValue(Object value)
Copyright © 2014–2017 The Redisson Project. All rights reserved.