Rename Miscellaneous#getMapValue -> getMapValues
This commit is contained in:
parent
8c0ebacd2b
commit
919edd3375
2 changed files with 8 additions and 5 deletions
|
@ -92,7 +92,7 @@ public final class Miscellaneous {
|
||||||
* @return all keys matching the specified value
|
* @return all keys matching the specified value
|
||||||
* @since 1-alpha0
|
* @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
|
return map
|
||||||
.entrySet().stream()
|
.entrySet().stream()
|
||||||
.filter(entry -> Objects.equals(entry.getValue(), value))
|
.filter(entry -> Objects.equals(entry.getValue(), value))
|
||||||
|
|
|
@ -20,13 +20,13 @@
|
||||||
package de.staropensource.sosengine.graphics;
|
package de.staropensource.sosengine.graphics;
|
||||||
|
|
||||||
import de.staropensource.sosengine.base.annotations.EventListener;
|
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.SubsystemMainClass;
|
||||||
|
import de.staropensource.sosengine.base.classes.events.EventPriority;
|
||||||
import de.staropensource.sosengine.base.classes.helpers.EventHelper;
|
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.events.internal.InternalEngineShutdownEvent;
|
||||||
import de.staropensource.sosengine.base.logging.LoggerInstance;
|
import de.staropensource.sosengine.base.logging.LoggerInstance;
|
||||||
import de.staropensource.sosengine.base.types.CodePart;
|
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.ListFormatter;
|
||||||
import de.staropensource.sosengine.base.utility.Miscellaneous;
|
import de.staropensource.sosengine.base.utility.Miscellaneous;
|
||||||
import de.staropensource.sosengine.graphics.classes.ApiMainClass;
|
import de.staropensource.sosengine.graphics.classes.ApiMainClass;
|
||||||
|
@ -35,7 +35,10 @@ import de.staropensource.sosengine.graphics.events.GraphicsErrorEvent;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import org.jetbrains.annotations.NotNull;
|
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.
|
* 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) {
|
public void registerGraphicsApi(@NotNull ApiMainClass mainClass) {
|
||||||
logger.verb("Registering Graphics API " + mainClass.getApiName() + " (" + mainClass.getClass().getName() + ")");
|
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)
|
if (output.length == 0 || output[0] == null)
|
||||||
registeredApis.put(mainClass.getApiName(), mainClass);
|
registeredApis.put(mainClass.getApiName(), mainClass);
|
||||||
|
|
Loading…
Reference in a new issue