From 919edd3375c26320b45c4088dd7953fd1689a523 Mon Sep 17 00:00:00 2001 From: JeremyStarTM Date: Thu, 27 Jun 2024 21:14:49 +0200 Subject: [PATCH] Rename Miscellaneous#getMapValue -> getMapValues --- .../sosengine/base/utility/Miscellaneous.java | 2 +- .../sosengine/graphics/GraphicsSubsystem.java | 11 +++++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/base/src/main/java/de/staropensource/sosengine/base/utility/Miscellaneous.java b/base/src/main/java/de/staropensource/sosengine/base/utility/Miscellaneous.java index ba31482..4785c49 100644 --- a/base/src/main/java/de/staropensource/sosengine/base/utility/Miscellaneous.java +++ b/base/src/main/java/de/staropensource/sosengine/base/utility/Miscellaneous.java @@ -92,7 +92,7 @@ public final class Miscellaneous { * @return all keys matching the specified value * @since 1-alpha0 */ - public static Set getMapValue(@NotNull Map map, @Nullable Object value) { + public static Set getMapValues(@NotNull Map map, @Nullable Object value) { return map .entrySet().stream() .filter(entry -> Objects.equals(entry.getValue(), value)) diff --git a/graphics/src/main/java/de/staropensource/sosengine/graphics/GraphicsSubsystem.java b/graphics/src/main/java/de/staropensource/sosengine/graphics/GraphicsSubsystem.java index 54ca00a..0784efa 100644 --- a/graphics/src/main/java/de/staropensource/sosengine/graphics/GraphicsSubsystem.java +++ b/graphics/src/main/java/de/staropensource/sosengine/graphics/GraphicsSubsystem.java @@ -20,13 +20,13 @@ package de.staropensource.sosengine.graphics; import de.staropensource.sosengine.base.annotations.EventListener; -import de.staropensource.sosengine.base.classes.events.EventPriority; import de.staropensource.sosengine.base.classes.SubsystemMainClass; +import de.staropensource.sosengine.base.classes.events.EventPriority; import de.staropensource.sosengine.base.classes.helpers.EventHelper; +import de.staropensource.sosengine.base.classes.logging.LogIssuer; import de.staropensource.sosengine.base.events.internal.InternalEngineShutdownEvent; import de.staropensource.sosengine.base.logging.LoggerInstance; import de.staropensource.sosengine.base.types.CodePart; -import de.staropensource.sosengine.base.classes.logging.LogIssuer; import de.staropensource.sosengine.base.utility.ListFormatter; import de.staropensource.sosengine.base.utility.Miscellaneous; import de.staropensource.sosengine.graphics.classes.ApiMainClass; @@ -35,7 +35,10 @@ import de.staropensource.sosengine.graphics.events.GraphicsErrorEvent; import lombok.Getter; import org.jetbrains.annotations.NotNull; -import java.util.*; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; /** * The main object for sos!engine's graphics subsystem. @@ -161,7 +164,7 @@ public final class GraphicsSubsystem implements SubsystemMainClass { public void registerGraphicsApi(@NotNull ApiMainClass mainClass) { logger.verb("Registering Graphics API " + mainClass.getApiName() + " (" + mainClass.getClass().getName() + ")"); - Object[] output = Miscellaneous.getMapValue(registeredApis, mainClass).toArray(); + Object[] output = Miscellaneous.getMapValues(registeredApis, mainClass).toArray(); if (output.length == 0 || output[0] == null) registeredApis.put(mainClass.getApiName(), mainClass);