Files
Backend/src/main/java/xyz/mcutils/backend/model/cache/CachedPlayerName.java

41 lines
964 B
Java
Raw Normal View History

2024-04-10 07:43:38 +01:00
package cc.fascinated.model.cache;
2024-04-13 18:15:03 +01:00
import cc.fascinated.common.CachedResponse;
2024-04-13 17:30:08 +01:00
import com.fasterxml.jackson.annotation.JsonIgnore;
2024-04-13 17:21:49 +01:00
import lombok.Getter;
import lombok.ToString;
2024-04-10 07:43:38 +01:00
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 18:02:46 +01:00
public class CachedPlayerName extends CachedResponse {
2024-04-13 17:29:32 +01:00
/**
* The id of the player.
*/
2024-04-13 17:30:08 +01:00
@JsonIgnore
2024-04-13 17:29:32 +01:00
@Id private final String id;
2024-04-10 07:43:38 +01:00
/**
* The username of the player.
*/
2024-04-13 17:29:32 +01:00
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;
2024-04-13 17:29:32 +01:00
public CachedPlayerName(String id, String username, UUID uniqueId) {
2024-04-13 18:15:03 +01:00
super(Cache.defaultCache());
2024-04-13 17:29:32 +01:00
this.id = id;
2024-04-13 17:21:33 +01:00
this.username = username;
this.uniqueId = uniqueId;
}
2024-04-10 07:43:38 +01:00
}