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

40 lines
983 B
Java
Raw Normal View History

2024-04-13 20:53:31 +01:00
package xyz.mcutils.backend.model.cache;
2024-04-10 07:43:38 +01:00
2024-04-13 17:30:08 +01:00
import com.fasterxml.jackson.annotation.JsonIgnore;
2024-04-19 20:46:30 +01:00
import lombok.*;
2024-04-10 07:43:38 +01:00
import org.springframework.data.annotation.Id;
import org.springframework.data.redis.core.RedisHash;
2024-04-13 20:53:31 +01:00
import xyz.mcutils.backend.common.CachedResponse;
2024-04-10 07:43:38 +01:00
import java.util.UUID;
/**
* @author Braydon
*/
2024-04-19 20:46:30 +01:00
@Setter
@Getter @EqualsAndHashCode(callSuper = false)
@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
}