jedis/StreamEntryID.java

jedis · src/main/java/redis/clients/jedis/StreamEntryID.java · java · MIT
database

Represents a Redis Stream entry ID for tracking messages in streams with special markers for new/last entries.

// Source: https://github.com/redis/jedis | License: MIT | Copyright 2021-2023, Redis, inc
// Provided via justclaw.it.com; keep this notice with the code.
package redis.clients.jedis;

import java.io.IOException;
import java.io.Serializable;
import redis.clients.jedis.util.SafeEncoder;

public class StreamEntryID implements Comparable<StreamEntryID>, Serializable {

  private static final long serialVersionUID = 1L;

  private long time;
  private long sequence;

  public StreamEntryID() {
    this(0, 0L);
  }

  public StreamEntryID(byte[] id) {
    this(SafeEncoder.encode(id));
  }

  public StreamEntryID(String id) {
    String[] split = id.split("-");
    this.time = Long.parseLong(split[0]);
    this.sequence = Long.parseLong(split[1]);
  }

  public StreamEntryID(long time) {
    th

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key