mirror of
https://github.com/plan-player-analytics/Plan.git
synced 2025-03-31 18:00:30 +08:00
Reformats code
This commit is contained in:
parent
deae15faa3
commit
1c5db5bad0
Plan/src/main/java/com/djrapitops/plan
data
database
locale
ui/webserver
utilities
@ -484,14 +484,6 @@ public class UserData {
|
||||
return gmTimes;
|
||||
}
|
||||
|
||||
public void setGmTimes(Map<String, Long> times) {
|
||||
if (Verify.notNull(times)) {
|
||||
for (Map.Entry<String, Long> entry : times.entrySet()) {
|
||||
gmTimes.setTime(entry.getKey(), entry.getValue());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the GM Times object containing playtime in each gamemode.
|
||||
*
|
||||
@ -503,6 +495,14 @@ public class UserData {
|
||||
}
|
||||
}
|
||||
|
||||
public void setGmTimes(Map<String, Long> times) {
|
||||
if (Verify.notNull(times)) {
|
||||
for (Map.Entry<String, Long> entry : times.entrySet()) {
|
||||
gmTimes.setTime(entry.getKey(), entry.getValue());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Is the user Operator?
|
||||
*
|
||||
|
@ -56,7 +56,7 @@ public class DBUtils {
|
||||
}
|
||||
|
||||
/**
|
||||
* @param <T> Object type
|
||||
* @param <T> Object type
|
||||
* @param objects Collection of the objects
|
||||
* @return Lists with max size of BATCH_SIZE
|
||||
*/
|
||||
@ -83,7 +83,7 @@ public class DBUtils {
|
||||
}
|
||||
|
||||
/**
|
||||
* @param <T> Object type
|
||||
* @param <T> Object type
|
||||
* @param objects Collection of the objects
|
||||
* @return Lists with max size of BATCH_SIZE
|
||||
*/
|
||||
|
@ -100,7 +100,7 @@ public class IPsTable extends Table {
|
||||
|
||||
/**
|
||||
* @param userId The User ID for which the IPs should be saved for
|
||||
* @param ips The IPs
|
||||
* @param ips The IPs
|
||||
* @throws SQLException when an error at saving happens
|
||||
*/
|
||||
public void saveIPList(int userId, Set<InetAddress> ips) throws SQLException {
|
||||
|
@ -116,8 +116,8 @@ public class NicknamesTable extends Table {
|
||||
}
|
||||
|
||||
/**
|
||||
* @param userId The User ID for which the nicknames should be saved for
|
||||
* @param names The nicknames
|
||||
* @param userId The User ID for which the nicknames should be saved for
|
||||
* @param names The nicknames
|
||||
* @param lastNick The latest nickname
|
||||
* @throws SQLException when an error at saving happens
|
||||
*/
|
||||
|
@ -44,6 +44,21 @@ public class Locale implements Closeable {
|
||||
messages = new HashMap<>();
|
||||
}
|
||||
|
||||
public static void unload() {
|
||||
Locale locale = LocaleHolder.getLocale();
|
||||
if (locale != null) {
|
||||
locale.close();
|
||||
}
|
||||
}
|
||||
|
||||
public static Message get(Msg msg) {
|
||||
Locale locale = LocaleHolder.getLocale();
|
||||
if (locale == null) {
|
||||
throw new IllegalStateException("Locale has not been initialized.");
|
||||
}
|
||||
return locale.getMessage(msg);
|
||||
}
|
||||
|
||||
public void loadLocale() {
|
||||
String locale = Settings.LOCALE.toString().toUpperCase();
|
||||
Benchmark.start("Initializing locale");
|
||||
@ -325,31 +340,16 @@ public class Locale implements Closeable {
|
||||
LocaleHolder.locale = null;
|
||||
}
|
||||
|
||||
public static void unload() {
|
||||
Locale locale = LocaleHolder.getLocale();
|
||||
if (locale != null) {
|
||||
locale.close();
|
||||
}
|
||||
}
|
||||
|
||||
public static Message get(Msg msg) {
|
||||
Locale locale = LocaleHolder.getLocale();
|
||||
if (locale == null) {
|
||||
throw new IllegalStateException("Locale has not been initialized.");
|
||||
}
|
||||
return locale.getMessage(msg);
|
||||
}
|
||||
|
||||
private static class LocaleHolder {
|
||||
|
||||
private static Locale locale;
|
||||
|
||||
public static void setLocale(Locale locale) {
|
||||
LocaleHolder.locale = locale;
|
||||
}
|
||||
|
||||
public static Locale getLocale() {
|
||||
return locale;
|
||||
}
|
||||
|
||||
public static void setLocale(Locale locale) {
|
||||
LocaleHolder.locale = locale;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -147,11 +147,11 @@ public enum Msg {
|
||||
this.identifier = identifier;
|
||||
}
|
||||
|
||||
public String getIdentifier() {
|
||||
return identifier;
|
||||
}
|
||||
|
||||
public static Map<String, Msg> getIdentifiers() {
|
||||
return Arrays.stream(values()).collect(Collectors.toMap(Msg::getIdentifier, Function.identity()));
|
||||
}
|
||||
|
||||
public String getIdentifier() {
|
||||
return identifier;
|
||||
}
|
||||
}
|
||||
|
@ -103,7 +103,8 @@ public class Request implements Closeable {
|
||||
if (reqLine.length >= 2) {
|
||||
request = reqLine[0];
|
||||
target = reqLine[1].replace("%20", " ")
|
||||
.replace("%2E", ".");;
|
||||
.replace("%2E", ".");
|
||||
;
|
||||
} else {
|
||||
request = "GET";
|
||||
target = "/";
|
||||
|
@ -29,6 +29,7 @@ public class PassEncryptUtil {
|
||||
public static final int HASH_SIZE_INDEX = 2;
|
||||
public static final int SALT_INDEX = 3;
|
||||
public static final int PBKDF2_INDEX = 4;
|
||||
|
||||
/**
|
||||
* Constructor used to hide the public constructor
|
||||
*/
|
||||
|
@ -267,7 +267,7 @@ public class Analysis {
|
||||
long now = MiscUtils.getTime();
|
||||
|
||||
Benchmark.start("Fill Dataset");
|
||||
List<PluginData> banSources = plugin.getHookHandler().getAdditionalDataSources()
|
||||
List<PluginData> banSources = plugin.getHookHandler().getAdditionalDataSources()
|
||||
.stream().filter(PluginData::isBanData).collect(Collectors.toList());
|
||||
rawData.forEach(uData -> {
|
||||
uData.access();
|
||||
|
@ -13,6 +13,7 @@ public class MathUtils {
|
||||
|
||||
private static final DecimalFormatSymbols decimalFormatSymbols = new DecimalFormatSymbols(Locale.ENGLISH);
|
||||
private static final DecimalFormat decimalFormat = new DecimalFormat("#.##", decimalFormatSymbols);
|
||||
|
||||
/**
|
||||
* Constructor used to hide the public constructor
|
||||
*/
|
||||
|
@ -10,8 +10,8 @@ import java.util.Map;
|
||||
/**
|
||||
* Compares Locale Map Entries and sorts them alphabetically according to the Enum Names.
|
||||
*
|
||||
* @since 3.6.2
|
||||
* @author Rsl1122
|
||||
* @since 3.6.2
|
||||
*/
|
||||
public class LocaleEntryComparator implements Comparator<Map.Entry<Msg, Message>> {
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user