Files
Backend/src/main/java/cc/fascinated/model/cache/CachedPlayerName.java

31 lines
732 B
Java
Raw Normal View History

2024-04-10 07:43:38 +01:00
package cc.fascinated.model.cache;
import lombok.*;
import org.springframework.data.annotation.Id;
import org.springframework.data.redis.core.RedisHash;
import java.util.UUID;
/**
* @author Braydon
*/
@Getter
@ToString
@RedisHash(value = "playerName", timeToLive = 60L * 60L * 6) // 6 hours (in seconds)
2024-04-13 17:21:33 +01:00
public final class CachedPlayerName extends CachedResponse {
2024-04-10 07:43:38 +01:00
/**
* The username of the player.
*/
2024-04-13 17:21:33 +01:00
@Id private final String username;
2024-04-10 07:43:38 +01:00
/**
* The unique id of the player.
*/
2024-04-13 17:21:33 +01:00
private final UUID uniqueId;
public CachedPlayerName(String username, UUID uniqueId) {
super(CacheInformation.defaultCache());
this.username = username;
this.uniqueId = uniqueId;
}
2024-04-10 07:43:38 +01:00
}