mirror of
https://github.com/danieldemus/openhab-core.git
synced 2025-01-11 05:41:52 +01:00
Remove deprecated methods from Configuration, UID and ThingHelper (#1629)
Removes the following deprecated methods: * org.openhab.core.config.core.Configuration.get(Object) * org.openhab.core.config.core.Configuration.remove(Object) * org.openhab.core.thing.UID.getSegments() * org.openhab.core.thing.util.ThingHelper.ensureUnique(Collection<Channel>) Signed-off-by: Wouter Born <github@maindrain.net>
This commit is contained in:
parent
695647c7f6
commit
b3880ebe88
@ -91,14 +91,6 @@ public class Configuration {
|
||||
return properties.containsKey(key);
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link #get(String)} instead.
|
||||
*/
|
||||
@Deprecated
|
||||
public Object get(Object key) {
|
||||
return this.get((String) key);
|
||||
}
|
||||
|
||||
public Object get(String key) {
|
||||
return properties.get(key);
|
||||
}
|
||||
@ -107,14 +99,6 @@ public class Configuration {
|
||||
return properties.put(key, ConfigUtil.normalizeType(value, null));
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link #remove(String)} instead.
|
||||
*/
|
||||
@Deprecated
|
||||
public Object remove(Object key) {
|
||||
return remove((String) key);
|
||||
}
|
||||
|
||||
public Object remove(String key) {
|
||||
return properties.remove(key);
|
||||
}
|
||||
|
@ -75,15 +75,6 @@ public abstract class UID extends AbstractUID {
|
||||
return getSegment(0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated use {@link #getAllSegments()} instead
|
||||
*/
|
||||
@Deprecated
|
||||
protected String[] getSegments() {
|
||||
final List<String> segments = super.getAllSegments();
|
||||
return segments.toArray(new String[segments.size()]);
|
||||
}
|
||||
|
||||
@Override
|
||||
// Avoid subclasses to require importing the o.e.sh.core.common package
|
||||
protected List<String> getAllSegments() {
|
||||
|
@ -108,19 +108,6 @@ public class ThingHelper {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link ThingHelper#ensureUniqueChannels(Collection)} instead.
|
||||
*/
|
||||
@Deprecated
|
||||
public static void ensureUnique(Collection<Channel> channels) {
|
||||
Set<UID> ids = new HashSet<>();
|
||||
for (Channel channel : channels) {
|
||||
if (!ids.add(channel.getUID())) {
|
||||
throw new IllegalArgumentException("Duplicate channels " + channel.getUID().getAsString());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Ensures that there are no duplicate channels in the array (i.e. not using the same ChannelUID)
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user