org.eclipse.smarthome.core.items.Item.getType()方法的使用及代码示例 您所在的位置:网站首页 eclipse禁用api org.eclipse.smarthome.core.items.Item.getType()方法的使用及代码示例

org.eclipse.smarthome.core.items.Item.getType()方法的使用及代码示例

2023-03-22 14:16| 来源: 网络整理| 查看: 265

本文整理了Java中org.eclipse.smarthome.core.items.Item.getType()方法的一些代码示例,展示了Item.getType()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Item.getType()方法的具体详情如下:包路径:org.eclipse.smarthome.core.items.Item类名称:Item方法名:getType

Item.getType介绍

[英]returns the item type as defined by ItemFactorys[中]返回ItemFactorys定义的项类型

代码示例

代码示例来源:origin: eclipse/smarthome

/** * Translates the Items class simple name into a type name understandable by * the {@link ItemFactory}s. * * @param item the Item to translate the name * @return the translated ItemTypeName understandable by the {@link ItemFactory}s */private @NonNull String toItemFactoryName(Item item) { return item.getType();}

代码示例来源:origin: eclipse/smarthome

@Overridepublic Collection getItemsOfType(String type) { Collection matchedItems = new ArrayList(); for (Item item : getItems()) { if (item.getType().equals(type)) { matchedItems.add(item); } } return matchedItems;}

代码示例来源:origin: eclipse/smarthome

private static List parseStates(@Nullable Item baseItem, String @Nullable [] params) { List states = new ArrayList(); if (params == null || baseItem == null) { return states; } for (String param : params) { State state = TypeParser.parseState(baseItem.getAcceptedDataTypes(), param); if (state == null) { LoggerFactory.getLogger(ItemDTOMapper.class).warn( "State '{}' is not valid for a group item with base type '{}'", new Object[] { param, baseItem.getType() }); states.clear(); break; } else { states.add(state); } } return states;}

代码示例来源:origin: eclipse/smarthome

private static void fillProperties(ItemDTO itemDTO, Item item) { if (item instanceof GroupItem) { GroupItem groupItem = (GroupItem) item; GroupItemDTO groupItemDTO = (GroupItemDTO) itemDTO; if (groupItem.getBaseItem() != null) { groupItemDTO.groupType = groupItem.getBaseItem().getType(); groupItemDTO.function = mapFunction(groupItem.getFunction()); } } itemDTO.name = item.getName(); itemDTO.type = item.getType(); itemDTO.label = item.getLabel(); itemDTO.tags = item.getTags(); itemDTO.category = item.getCategory(); itemDTO.groupNames = item.getGroupNames();}

代码示例来源:origin: eclipse/smarthome

public ItemBuilderImpl(Set itemFactories, Item item) { this.itemFactories = itemFactories; this.itemType = item.getType(); this.name = item.getName(); this.category = item.getCategory(); this.groups = item.getGroupNames(); this.label = item.getLabel(); this.tags = item.getTags(); if (item instanceof GroupItem) { this.baseItem = ((GroupItem) item).getBaseItem(); this.groupFunction = ((GroupItem) item).getFunction(); }}

代码示例来源:origin: openhab/openhab-core

/** * Translates the Items class simple name into a type name understandable by * the {@link ItemFactory}s. * * @param item the Item to translate the name * @return the translated ItemTypeName understandable by the {@link ItemFactory}s */private @NonNull String toItemFactoryName(Item item) { return item.getType();}

代码示例来源:origin: openhab/openhab-core

@Overridepublic Collection getItemsOfType(String type) { Collection matchedItems = new ArrayList(); for (Item item : getItems()) { if (item.getType().equals(type)) { matchedItems.add(item); } } return matchedItems;}

代码示例来源:origin: openhab/openhab-core

private @Nullable ProfileTypeUID getAdvice(ItemChannelLink link, Item item, Channel channel) { ProfileTypeUID ret; for (ProfileAdvisor advisor : profileAdvisors) { ret = advisor.getSuggestedProfileTypeUID(channel, item.getType()); if (ret != null) { return ret; } } return null;}

代码示例来源:origin: openhab/openhab-core

private boolean isSupportedItemType(ProfileType profileType, Item item) { return profileType.getSupportedItemTypes().isEmpty() || profileType.getSupportedItemTypes().contains(item.getType());}

代码示例来源:origin: openhab/openhab-core

private static List parseStates(@Nullable Item baseItem, String @Nullable [] params) { List states = new ArrayList(); if (params == null || baseItem == null) { return states; } for (String param : params) { State state = TypeParser.parseState(baseItem.getAcceptedDataTypes(), param); if (state == null) { LoggerFactory.getLogger(ItemDTOMapper.class).warn( "State '{}' is not valid for a group item with base type '{}'", new Object[] { param, baseItem.getType() }); states.clear(); break; } else { states.add(state); } } return states;}

代码示例来源:origin: openhab/openhab-core

private @Nullable ProfileTypeUID determineProfileTypeUID(ItemChannelLink link, Item item, @Nullable Thing thing) { ProfileTypeUID profileTypeUID = getConfiguredProfileTypeUID(link); Channel channel = null; if (profileTypeUID == null) { if (thing == null) { return null; } channel = thing.getChannel(link.getLinkedUID().getId()); if (channel == null) { return null; } // ask advisors profileTypeUID = getAdvice(link, item, channel); if (profileTypeUID == null) { // ask default advisor logger.trace("No profile advisor found for link {}, falling back to the defaults", link); profileTypeUID = defaultProfileFactory.getSuggestedProfileTypeUID(channel, item.getType()); } } return profileTypeUID;}

代码示例来源:origin: openhab/openhab-core

logger.debug( "Received event '{}' ({}) could not be converted to any type accepted by item '{}' ({})", type, type.getClass().getSimpleName(), itemName, item.getType());

代码示例来源:origin: openhab/openhab-core

private static void fillProperties(ItemDTO itemDTO, Item item) { if (item instanceof GroupItem) { GroupItem groupItem = (GroupItem) item; GroupItemDTO groupItemDTO = (GroupItemDTO) itemDTO; if (groupItem.getBaseItem() != null) { groupItemDTO.groupType = groupItem.getBaseItem().getType(); groupItemDTO.function = mapFunction(groupItem.getFunction()); } } itemDTO.name = item.getName(); itemDTO.type = item.getType(); itemDTO.label = item.getLabel(); itemDTO.tags = item.getTags(); itemDTO.category = item.getCategory(); itemDTO.groupNames = item.getGroupNames();}

代码示例来源:origin: openhab/openhab-core

public ItemBuilderImpl(Set itemFactories, Item item) { this.itemFactories = itemFactories; this.itemType = item.getType(); this.name = item.getName(); this.category = item.getCategory(); this.groups = item.getGroupNames(); this.label = item.getLabel(); this.tags = item.getTags(); if (item instanceof GroupItem) { this.baseItem = ((GroupItem) item).getBaseItem(); this.groupFunction = ((GroupItem) item).getFunction(); }}

代码示例来源:origin: openhab/openhab-core

.substring(w.eClass().getInstanceTypeName().lastIndexOf(".") + 1);boolean drillDown = "mapview".equalsIgnoreCase(widgetTypeName);Predicate itemFilter = (i -> i.getType().equals(CoreItemFactory.LOCATION));event.item = EnrichedItemDTOMapper.map(item, drillDown, itemFilter, null, null);

代码示例来源:origin: openhab/openhab-core

.substring(widget.eClass().getInstanceTypeName().lastIndexOf(".") + 1);boolean isMapview = "mapview".equalsIgnoreCase(widgetTypeName);Predicate itemFilter = (i -> i.getType().equals(CoreItemFactory.LOCATION));bean.item = EnrichedItemDTOMapper.map(item, isMapview, itemFilter, UriBuilder.fromUri(uri).build(), locale);



【本文地址】

公司简介

联系我们

今日新闻

    推荐新闻

    专题文章
      CopyRight 2018-2019 实验室设备网 版权所有