All Downloads are FREE. Search and download functionalities are using the official Maven repository.

redis.clients.jedis.args.ExpiryOption Maven / Gradle / Ivy

There is a newer version: 5.2.0
Show newest version
package redis.clients.jedis.args;

import redis.clients.jedis.util.SafeEncoder;

/**
 * Enumeration of setting expiration.
 */
public enum ExpiryOption implements Rawable {

  /**
   * Set expiry only when the key has no expiry.
   */
  NX,

  /**
   * Set expiry only when the key has an existing expiry.
   */
  XX,

  /**
   * Set expiry only when the new expiry is greater than the existing one.
   */
  GT,

  /**
   * Set expiry only when the new expiry is less than the existing one.
   */
  LT;

  private final byte[] raw;

  private ExpiryOption() {
    raw = SafeEncoder.encode(name());
  }

  @Override
  public byte[] getRaw() {
    return raw;
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy