java.lang.Object
org.springframework.data.redis.core.convert.RedisData

public class RedisData extends Object
Data object holding Bucket representing the domain object to be stored in a Redis hash. Index information points to additional structures holding the objects is for searching.
Since:
1.7
Author:
Christoph Strobl, Mark Paluch
  • Constructor Details

    • RedisData

      public RedisData()
      Creates new RedisData with empty Bucket.
    • RedisData

      public RedisData(Map<byte[],byte[]> raw)
      Creates new RedisData with Bucket holding provided values.
      Parameters:
      raw - should not be null.
    • RedisData

      public RedisData(Bucket bucket)
      Creates new RedisData with Bucket
      Parameters:
      bucket - must not be null.
  • Method Details

    • setId

      public void setId(@Nullable String id)
      Set the id to be used as part of the key.
      Parameters:
      id -
    • getId

      @Nullable public String getId()
      Returns:
    • getTimeToLive

      @Nullable public Long getTimeToLive()
      Get the time before expiration in seconds.
      Returns:
      null if not set.
    • addIndexedData

      public void addIndexedData(IndexedData index)
      Parameters:
      index - must not be null.
    • addIndexedData

      public void addIndexedData(Collection<IndexedData> indexes)
      Parameters:
      indexes - must not be null.
    • getIndexedData

      public Set<IndexedData> getIndexedData()
      Returns:
      never null.
    • getKeyspace

      @Nullable public String getKeyspace()
      Returns:
    • setKeyspace

      public void setKeyspace(@Nullable String keyspace)
      Parameters:
      keyspace -
    • getBucket

      public Bucket getBucket()
      Returns:
    • setTimeToLive

      public void setTimeToLive(Long timeToLive)
      Set the time before expiration in TimeUnit.SECONDS.
      Parameters:
      timeToLive - can be null.
    • setTimeToLive

      public void setTimeToLive(Long timeToLive, TimeUnit timeUnit)
      Set the time before expiration converting the given arguments to TimeUnit.SECONDS.
      Parameters:
      timeToLive - must not be null
      timeUnit - must not be null
    • toString

      public String toString()
      Overrides:
      toString in class Object