mirror of
https://github.com/KDE/kdeconnect-android
synced 2025-08-30 21:55:10 +00:00
Use SetUtils in PluginFactory.
This commit is contained in:
committed by
Nicolas Fella
parent
144d5d431d
commit
87c1c44e68
@@ -34,6 +34,9 @@ import java.util.Map;
|
|||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.concurrent.ConcurrentHashMap;
|
import java.util.concurrent.ConcurrentHashMap;
|
||||||
|
|
||||||
|
import static org.apache.commons.collections4.SetUtils.emptyIfNull;
|
||||||
|
import static org.apache.commons.collections4.SetUtils.unmodifiableSet;
|
||||||
|
|
||||||
public class PluginFactory {
|
public class PluginFactory {
|
||||||
|
|
||||||
@IndexAnnotated
|
@IndexAnnotated
|
||||||
@@ -52,12 +55,8 @@ public class PluginFactory {
|
|||||||
this.hasSettings = hasSettings;
|
this.hasSettings = hasSettings;
|
||||||
this.supportsDeviceSpecificSettings = supportsDeviceSpecificSettings;
|
this.supportsDeviceSpecificSettings = supportsDeviceSpecificSettings;
|
||||||
this.listenToUnpaired = listenToUnpaired;
|
this.listenToUnpaired = listenToUnpaired;
|
||||||
HashSet<String> incoming = new HashSet<>();
|
this.supportedPacketTypes = emptyIfNull(unmodifiableSet(supportedPacketTypes));
|
||||||
if (supportedPacketTypes != null) Collections.addAll(incoming, supportedPacketTypes);
|
this.outgoingPacketTypes = emptyIfNull(unmodifiableSet(outgoingPacketTypes));
|
||||||
this.supportedPacketTypes = Collections.unmodifiableSet(incoming);
|
|
||||||
HashSet<String> outgoing = new HashSet<>();
|
|
||||||
if (outgoingPacketTypes != null) Collections.addAll(outgoing, outgoingPacketTypes);
|
|
||||||
this.outgoingPacketTypes = Collections.unmodifiableSet(outgoing);
|
|
||||||
this.instantiableClass = instantiableClass;
|
this.instantiableClass = instantiableClass;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user