Class PartialUpdate<T>
java.lang.Object
org.springframework.data.redis.core.PartialUpdate<T>
- Type Parameters:
T
-
PartialUpdate
allows to issue individual property updates without the need of rewriting the whole entity. It
allows to define set, delete actions on existing objects while taking care of updating
potential expiration times of the entity itself as well as index structures.- Since:
- 1.8
- Author:
- Christoph Strobl
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
static enum
-
Constructor Summary
ConstructorDescriptionPartialUpdate
(Object id, Class<T> targetType) Create newPartialUpdate
for given id and type.PartialUpdate
(Object id, T value) Create newPartialUpdate
for given id and object. -
Method Summary
Modifier and TypeMethodDescriptionRemove the value reachable via given path.getId()
Get the id of the element to update.Get the list of individual property updates.Get the target type.getValue()
boolean
static <S> PartialUpdate<S>
newPartialUpdate
(Object id, Class<S> targetType) Create newPartialUpdate
for given id and type.refreshTtl
(boolean refreshTtl) Set indicator for updating expiration time of target.Set the value of a simple or complex value reachable via given path.
-
Constructor Details
-
PartialUpdate
Create newPartialUpdate
for given id and type.- Parameters:
id
- must not be null.targetType
- must not be null.
-
PartialUpdate
Create newPartialUpdate
for given id and object.- Parameters:
id
- must not be null.value
- must not be null.
-
-
Method Details
-
newPartialUpdate
Create newPartialUpdate
for given id and type.- Parameters:
id
- must not be null.targetType
- must not be null.
-
getValue
- Returns:
- can be null.
-
set
Set the value of a simple or complex value reachable via given path.- Parameters:
path
- must not be null.value
- must not be null. If you want to remove a value usedel(String)
.- Returns:
- a new
PartialUpdate
.
-
del
Remove the value reachable via given path.- Parameters:
path
- path must not be null.- Returns:
- a new
PartialUpdate
.
-
getTarget
Get the target type.- Returns:
- never null.
-
getId
Get the id of the element to update.- Returns:
- never null.
-
getPropertyUpdates
Get the list of individual property updates.- Returns:
- never null.
-
isRefreshTtl
public boolean isRefreshTtl()- Returns:
- true if expiration time of target should be updated.
-
refreshTtl
Set indicator for updating expiration time of target.- Parameters:
refreshTtl
-- Returns:
- a new
PartialUpdate
.
-