Removed deprecated 'newItemBuilder' method (#1429)
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>pull/1436/head
parent
7940141421
commit
6b4e54ada3
|
@ -38,7 +38,6 @@ import org.eclipse.jdt.annotation.Nullable;
|
|||
import org.openhab.core.common.registry.RegistryChangeListener;
|
||||
import org.openhab.core.items.GroupItem;
|
||||
import org.openhab.core.items.Item;
|
||||
import org.openhab.core.items.ItemBuilder;
|
||||
import org.openhab.core.items.ItemBuilderFactory;
|
||||
import org.openhab.core.items.ItemNotFoundException;
|
||||
import org.openhab.core.items.ItemNotUniqueException;
|
||||
|
@ -1387,22 +1386,4 @@ public class ItemUIRegistryImpl implements ItemUIRegistry {
|
|||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemBuilder newItemBuilder(Item item) {
|
||||
if (itemBuilderFactory != null) {
|
||||
return itemBuilderFactory.newItemBuilder(item);
|
||||
} else {
|
||||
throw new IllegalStateException("Cannot create an item builder without the item registry");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemBuilder newItemBuilder(String itemType, String itemName) {
|
||||
if (itemBuilderFactory != null) {
|
||||
return itemBuilderFactory.newItemBuilder(itemType, itemName);
|
||||
} else {
|
||||
throw new IllegalStateException("Cannot create an item builder without the item registry");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -13,14 +13,10 @@
|
|||
package org.openhab.core.items;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
|
||||
import org.eclipse.jdt.annotation.NonNullByDefault;
|
||||
import org.eclipse.jdt.annotation.Nullable;
|
||||
import org.openhab.core.common.registry.Registry;
|
||||
import org.openhab.core.internal.items.ItemBuilderImpl;
|
||||
import org.openhab.core.library.CoreItemFactory;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* The ItemRegistry is the central place, where items are kept in memory and their state
|
||||
|
@ -123,35 +119,4 @@ public interface ItemRegistry extends Registry<Item, String> {
|
|||
*/
|
||||
void removeRegistryHook(RegistryHook<Item> hook);
|
||||
|
||||
/**
|
||||
* Create a new {@link ItemBuilder}, which is initialized by the given item.
|
||||
*
|
||||
* @param item the template to initialize the builder with
|
||||
* @return an ItemBuilder instance
|
||||
*
|
||||
* @deprecated Use the {@link ItemBuilderFactory} service instead.
|
||||
*/
|
||||
@Deprecated
|
||||
default ItemBuilder newItemBuilder(Item item) {
|
||||
LoggerFactory.getLogger(ItemRegistry.class)
|
||||
.warn("Deprecation: You are using a deprecated API. Please use the ItemBuilder OSGi service instead.");
|
||||
return new ItemBuilderImpl(Collections.singleton(new CoreItemFactory()), item);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a new {@link ItemBuilder}, which is initialized by the given item.
|
||||
*
|
||||
* @param itemType the item type to create
|
||||
* @param itemName the name of the item to create
|
||||
* @return an ItemBuilder instance
|
||||
*
|
||||
* @deprecated Use the {@link ItemBuilderFactory} service instead.
|
||||
*/
|
||||
@Deprecated
|
||||
default ItemBuilder newItemBuilder(String itemType, String itemName) {
|
||||
LoggerFactory.getLogger(ItemRegistry.class)
|
||||
.warn("Deprecation: You are using a deprecated API. Please use the ItemBuilder OSGi service instead.");
|
||||
return new ItemBuilderImpl(Collections.singleton(new CoreItemFactory()), itemType, itemName);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue