Implement Comparable on ModuleContainer
package io.github.nucleuspowered.nucleus.core.module;
import com.google.inject.Injector;
+import org.jetbrains.annotations.NotNull;
-public class ModuleContainer {
+public class ModuleContainer implements Comparable<ModuleContainer> {
private final String id;
private final String name;
@@ -44,6 +45,11 @@ public class ModuleContainer {
return injector.getInstance(this.moduleClass);
}
+ @Override
+ public int compareTo(@NotNull ModuleContainer o) {
+ return this.id.compareTo(o.id);
+ }
+
public static final class Configurable<T> extends ModuleContainer {
private final Class<T> configurationClass;
