mirror of
https://github.com/proxiodev/RedisBungee.git
synced 2024-11-22 20:28:00 +00:00
expose CachedUUIDEntry Class
This commit is contained in:
parent
ae6961ef24
commit
ddfc689c2d
@ -0,0 +1,42 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2013-present RedisBungee contributors
|
||||||
|
*
|
||||||
|
* All rights reserved. This program and the accompanying materials
|
||||||
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
|
* which accompanies this distribution, and is available at
|
||||||
|
*
|
||||||
|
* http://www.eclipse.org/legal/epl-v10.html
|
||||||
|
*/
|
||||||
|
|
||||||
|
package com.imaginarycode.minecraft.redisbungee.api.util.uuid;
|
||||||
|
|
||||||
|
import java.util.Calendar;
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
|
public class CachedUUIDEntry {
|
||||||
|
private final String name;
|
||||||
|
private final UUID uuid;
|
||||||
|
private final Calendar expiry;
|
||||||
|
|
||||||
|
public CachedUUIDEntry(String name, UUID uuid, Calendar expiry) {
|
||||||
|
this.name = name;
|
||||||
|
this.uuid = uuid;
|
||||||
|
this.expiry = expiry;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getName() {
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public UUID getUuid() {
|
||||||
|
return uuid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Calendar getExpiry() {
|
||||||
|
return expiry;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean expired() {
|
||||||
|
return Calendar.getInstance().after(expiry);
|
||||||
|
}
|
||||||
|
}
|
@ -194,31 +194,5 @@ public final class UUIDTranslator {
|
|||||||
unifiedJedis.hset("uuid-cache", ImmutableMap.of(name.toLowerCase(), json, uuid.toString(), json));
|
unifiedJedis.hset("uuid-cache", ImmutableMap.of(name.toLowerCase(), json, uuid.toString(), json));
|
||||||
}
|
}
|
||||||
|
|
||||||
private static class CachedUUIDEntry {
|
|
||||||
private final String name;
|
|
||||||
private final UUID uuid;
|
|
||||||
private final Calendar expiry;
|
|
||||||
|
|
||||||
public CachedUUIDEntry(String name, UUID uuid, Calendar expiry) {
|
|
||||||
this.name = name;
|
|
||||||
this.uuid = uuid;
|
|
||||||
this.expiry = expiry;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getName() {
|
|
||||||
return name;
|
|
||||||
}
|
|
||||||
|
|
||||||
public UUID getUuid() {
|
|
||||||
return uuid;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Calendar getExpiry() {
|
|
||||||
return expiry;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean expired() {
|
|
||||||
return Calendar.getInstance().after(expiry);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user