From abd8ee4cc01f9006c97dd99daf016724576b717d Mon Sep 17 00:00:00 2001 From: Robert von Burg Date: Thu, 8 Feb 2024 16:23:20 +0100 Subject: [PATCH] [Minor] Removed DefaultRuntimeRegistry.exists(String, Class) --- .../registry/impl/DefaultRuntimeRegistry.java | 25 +++---------------- 1 file changed, 3 insertions(+), 22 deletions(-) diff --git a/pi4j-core/src/main/java/com/pi4j/registry/impl/DefaultRuntimeRegistry.java b/pi4j-core/src/main/java/com/pi4j/registry/impl/DefaultRuntimeRegistry.java index 2d996372..8118741e 100644 --- a/pi4j-core/src/main/java/com/pi4j/registry/impl/DefaultRuntimeRegistry.java +++ b/pi4j-core/src/main/java/com/pi4j/registry/impl/DefaultRuntimeRegistry.java @@ -34,7 +34,9 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import java.util.*; +import java.util.Collections; +import java.util.Map; +import java.util.Set; import java.util.concurrent.ConcurrentHashMap; /** @@ -171,27 +173,6 @@ public synchronized boolean exists(int address) { return Collections.unmodifiableMap(this.instances); } - /** {@inheritDoc} */ - public synchronized boolean exists(String id, Class type){ - String _id = null; - try { - _id = validateId(id); - - // return 'false' if the requested ID is not found - if(!instances.containsKey(_id)) - return false; - - // get the I/O instance - IO instance = instances.get(id); - - // return true if the I/O instance matches the requested I/O type - return type.isAssignableFrom(instance.getClass()); - } catch (IOInvalidIDException e) { - return false; - } - } - - private String validateId(String id) throws IOInvalidIDException { if(id == null) throw new IOInvalidIDException();