replace an internal class by a record in PlayerFinder
This commit is contained in:
parent
4edf759bd3
commit
6ef8557c34
@ -37,16 +37,7 @@ public class PlayerFinder {
|
|||||||
.maximumSize(1000)
|
.maximumSize(1000)
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
//record PlayerIdCacheKey(String pName, boolean old) { } // Java 16
|
record PlayerIdCacheKey(String pName, boolean old) { }
|
||||||
static class PlayerIdCacheKey {
|
|
||||||
private final String pName;
|
|
||||||
private final boolean old;
|
|
||||||
public PlayerIdCacheKey(String pName, boolean old) {
|
|
||||||
this.pName = pName; this.old = old;
|
|
||||||
}
|
|
||||||
public String pName() { return pName; }
|
|
||||||
public boolean old() { return old; }
|
|
||||||
}
|
|
||||||
private static Cache<PlayerIdCacheKey, UUID> playerId = CacheBuilder.newBuilder()
|
private static Cache<PlayerIdCacheKey, UUID> playerId = CacheBuilder.newBuilder()
|
||||||
.expireAfterWrite(2, TimeUnit.MINUTES)
|
.expireAfterWrite(2, TimeUnit.MINUTES)
|
||||||
.maximumSize(1000)
|
.maximumSize(1000)
|
||||||
|
Loading…
Reference in New Issue
Block a user