diff options
author | Luck <git@lucko.me> | 2019-08-09 20:35:26 +0100 |
---|---|---|
committer | Luck <git@lucko.me> | 2019-08-09 20:35:26 +0100 |
commit | dc6968c4b56d9f04fa1b56808c298bdda77a442c (patch) | |
tree | 438189e04143ed578850cc5274fc0f6e995f8d60 /spark-common/src | |
parent | 87c818a71b7102c9a8bcbf8d125a80da599ea965 (diff) | |
download | spark-dc6968c4b56d9f04fa1b56808c298bdda77a442c.tar.gz spark-dc6968c4b56d9f04fa1b56808c298bdda77a442c.tar.bz2 spark-dc6968c4b56d9f04fa1b56808c298bdda77a442c.zip |
Codestyle changes
Diffstat (limited to 'spark-common/src')
5 files changed, 10 insertions, 10 deletions
diff --git a/spark-common/src/main/java/me/lucko/spark/common/command/modules/HealthModule.java b/spark-common/src/main/java/me/lucko/spark/common/command/modules/HealthModule.java index 86ab047..0737a00 100644 --- a/spark-common/src/main/java/me/lucko/spark/common/command/modules/HealthModule.java +++ b/spark-common/src/main/java/me/lucko/spark/common/command/modules/HealthModule.java @@ -256,7 +256,7 @@ public class HealthModule implements CommandModule { ); } - private static TextComponent formatTps(double tps) { + public static TextComponent formatTps(double tps) { TextColor color; if (tps > 18.0) { color = TextColor.GREEN; @@ -269,7 +269,7 @@ public class HealthModule implements CommandModule { return TextComponent.of( (tps > 20.0 ? "*" : "") + Math.min(Math.round(tps * 100.0) / 100.0, 20.0), color); } - private static TextComponent formatCpuUsage(double usage) { + public static TextComponent formatCpuUsage(double usage) { TextColor color; if (usage > 0.9) { color = TextColor.RED; diff --git a/spark-common/src/main/java/me/lucko/spark/common/heapdump/HeapDump.java b/spark-common/src/main/java/me/lucko/spark/common/heapdump/HeapDump.java index 189f89e..f2c1c72 100644 --- a/spark-common/src/main/java/me/lucko/spark/common/heapdump/HeapDump.java +++ b/spark-common/src/main/java/me/lucko/spark/common/heapdump/HeapDump.java @@ -31,9 +31,8 @@ import java.nio.file.Path; /** * Utility for creating .hprof memory heap snapshots. */ -public final class HeapDump { - - private HeapDump() {} +public enum HeapDump { + ; /** The object name of the com.sun.management.HotSpotDiagnosticMXBean */ private static final String DIAGNOSTIC_BEAN = "com.sun.management:type=HotSpotDiagnostic"; diff --git a/spark-common/src/main/java/me/lucko/spark/common/monitor/cpu/CpuMonitor.java b/spark-common/src/main/java/me/lucko/spark/common/monitor/cpu/CpuMonitor.java index f4190e5..cd451ed 100644 --- a/spark-common/src/main/java/me/lucko/spark/common/monitor/cpu/CpuMonitor.java +++ b/spark-common/src/main/java/me/lucko/spark/common/monitor/cpu/CpuMonitor.java @@ -34,8 +34,8 @@ import java.util.concurrent.TimeUnit; /** * Exposes and monitors the system/process CPU usage. */ -public final class CpuMonitor { - private CpuMonitor() {} +public enum CpuMonitor { + ; /** The object name of the com.sun.management.OperatingSystemMXBean */ private static final String OPERATING_SYSTEM_BEAN = "java.lang:type=OperatingSystem"; diff --git a/spark-common/src/main/java/me/lucko/spark/common/util/FormatUtil.java b/spark-common/src/main/java/me/lucko/spark/common/util/FormatUtil.java index 37165d1..8713678 100644 --- a/spark-common/src/main/java/me/lucko/spark/common/util/FormatUtil.java +++ b/spark-common/src/main/java/me/lucko/spark/common/util/FormatUtil.java @@ -20,8 +20,8 @@ package me.lucko.spark.common.util; -public final class FormatUtil { - private FormatUtil() {} +public enum FormatUtil { + ; public static String percent(double value, double max) { double percent = (value * 100d) / max; diff --git a/spark-common/src/main/java/me/lucko/spark/common/util/TypeDescriptors.java b/spark-common/src/main/java/me/lucko/spark/common/util/TypeDescriptors.java index a232e77..c827c69 100644 --- a/spark-common/src/main/java/me/lucko/spark/common/util/TypeDescriptors.java +++ b/spark-common/src/main/java/me/lucko/spark/common/util/TypeDescriptors.java @@ -23,7 +23,8 @@ package me.lucko.spark.common.util; /** * Utilities for working with Java type descriptors. */ -public final class TypeDescriptors { +public enum TypeDescriptors { + ; /** * Returns the Java type corresponding to the given type descriptor. |