Class RedisSetCommand

java.lang.Object
com.arms.api.util.redisrepo.RedisSetCommand

@Component public class RedisSetCommand extends Object
  • Constructor Details

    • RedisSetCommand

      public RedisSetCommand(org.springframework.data.redis.core.RedisTemplate<String,Object> redisTemplate)
  • Method Details

    • add

      public Long add(String key, Object... values)
      Set에 하나 이상의 멤버를 추가 (SADD)
    • getAll

      public Set<Object> getAll(String key)
      Set의 모든 멤버를 조회 (SMEMBERS)
    • size

      public Long size(String key)
      Set의 멤버 수를 조회 (SCARD)
    • isMember

      public Boolean isMember(String key, Object value)
      Set에 특정 멤버가 존재하는지 확인 (SISMEMBER)
    • getRandom

      public Object getRandom(String key)
      랜덤 멤버를 조회 (SRANDMEMBER)
    • getRandom

      public List<Object> getRandom(String key, long count)
      랜덤 멤버를 count개 조회 (SRANDMEMBER count)
    • union

      public Set<Object> union(String key, String otherKey)
      두 Set의 합집합을 조회 (SUNION)
    • intersect

      public Set<Object> intersect(String key, String otherKey)
      두 Set의 교집합을 조회 (SINTER)
    • difference

      public Set<Object> difference(String key, String otherKey)
      두 Set의 차집합을 조회 (SDIFF)
    • remove

      public Long remove(String key, Object... values)
      Set에서 하나 이상의 멤버를 삭제 (SREM)
    • pop

      public Object pop(String key)
      Set에서 랜덤 멤버를 꺼냄 (SPOP)