test_class.declarator: itemFactory
test_class.modifier: private
test_class.original_string: private CoreItemFactory itemFactory;
test_class.type: CoreItemFactory
test_class.var_name: itemFactory
test_class.file: bundles/org.openhab.core.io.rest.core/src/test/java/org/openhab/core/io/rest/core/item/EnrichedItemDTOMapperTest.java
test_class.identifier: EnrichedItemDTOMapperTest
test_class.superclass: extends JavaTest
test_case.body: @Test
      public void testFiltering() {
          GroupItem group = new GroupItem("TestGroup");
          GroupItem subGroup = new GroupItem("TestSubGroup");
          GenericItem switchItem = itemFactory.createItem(CoreItemFactory.SWITCH, "TestSwitch");
          GenericItem numberItem = itemFactory.createItem(CoreItemFactory.NUMBER, "TestNumber");
          GenericItem stringItem = itemFactory.createItem(CoreItemFactory.STRING, "TestString");
  
          if (switchItem != null && numberItem != null && stringItem != null) {
              group.addMember(subGroup);
              group.addMember(switchItem);
              group.addMember(numberItem);
              subGroup.addMember(stringItem);
          }
  
          EnrichedGroupItemDTO dto = (EnrichedGroupItemDTO) EnrichedItemDTOMapper.map(group, false, null, null, null);
          assertThat(dto.members.length, is(0));
  
          dto = (EnrichedGroupItemDTO) EnrichedItemDTOMapper.map(group, true, null, null, null);
          assertThat(dto.members.length, is(3));
          assertThat(((EnrichedGroupItemDTO) dto.members[0]).members.length, is(1));
  
          dto = (EnrichedGroupItemDTO) EnrichedItemDTOMapper.map(group, true,
                  i -> CoreItemFactory.NUMBER.equals(i.getType()), null, null);
          assertThat(dto.members.length, is(1));
  
          dto = (EnrichedGroupItemDTO) EnrichedItemDTOMapper.map(group, true,
                  i -> CoreItemFactory.NUMBER.equals(i.getType()) || i instanceof GroupItem, null, null);
          assertThat(dto.members.length, is(2));
          assertThat(((EnrichedGroupItemDTO) dto.members[0]).members.length, is(0));
  
          dto = (EnrichedGroupItemDTO) EnrichedItemDTOMapper.map(group, true,
                  i -> CoreItemFactory.NUMBER.equals(i.getType()) || i instanceof GroupItem, null, null);
          assertThat(dto.members.length, is(2));
          assertThat(((EnrichedGroupItemDTO) dto.members[0]).members.length, is(0));
  
          dto = (EnrichedGroupItemDTO) EnrichedItemDTOMapper.map(group, true,
                  i -> CoreItemFactory.NUMBER.equals(i.getType()) || i.getType().equals(CoreItemFactory.STRING)
                          || i instanceof GroupItem,
                  null, null);
          assertThat(dto.members.length, is(2));
          assertThat(((EnrichedGroupItemDTO) dto.members[0]).members.length, is(1));
      }
test_case.class_method_signature: EnrichedItemDTOMapperTest.testFiltering()
test_case.full_signature: @Test public void testFiltering()
test_case.identifier: testFiltering
test_case.invocations: createItem createItem createItem addMember addMember addMember addMember map assertThat is map assertThat is assertThat is map equals getType assertThat is map equals getType assertThat is assertThat is map equals getType assertThat is assertThat is map equals getType equals getType assertThat is assertThat is
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testFiltering()
focal_class.declarator: LOGGER = LoggerFactory.getLogger(EnrichedItemDTOMapper.class)
focal_class.modifier: private static final
focal_class.original_string: private static final Logger LOGGER = LoggerFactory.getLogger(EnrichedItemDTOMapper.class);
focal_class.type: Logger
focal_class.var_name: LOGGER
focal_class.file: bundles/org.openhab.core.io.rest.core/src/main/java/org/openhab/core/io/rest/core/item/EnrichedItemDTOMapper.java
focal_class.identifier: EnrichedItemDTOMapper
focal_class.class_method_signature: EnrichedItemDTOMapper.map(Item item, boolean drillDown, @Nullable Predicate<Item> itemFilter,
              @Nullable UriBuilder uriBuilder, @Nullable Locale locale)
focal_class.full_signature: public static EnrichedItemDTO map(Item item, boolean drillDown, @Nullable Predicate<Item> itemFilter,
              @Nullable UriBuilder uriBuilder, @Nullable Locale locale)
focal_class.identifier: map
focal_class.modifiers: public static
focal_class.parameters: (Item item, boolean drillDown, @Nullable Predicate<Item> itemFilter,
              @Nullable UriBuilder uriBuilder, @Nullable Locale locale)
focal_class.return: EnrichedItemDTO
focal_class.signature: EnrichedItemDTO map(Item item, boolean drillDown, @Nullable Predicate<Item> itemFilter,
              @Nullable UriBuilder uriBuilder, @Nullable Locale locale)
focal_class.class_method_signature: EnrichedItemDTOMapper.map(Item item, ItemDTO itemDTO, @Nullable UriBuilder uriBuilder, boolean drillDown,
              @Nullable Predicate<Item> itemFilter, @Nullable Locale locale)
focal_class.full_signature: private static EnrichedItemDTO map(Item item, ItemDTO itemDTO, @Nullable UriBuilder uriBuilder, boolean drillDown,
              @Nullable Predicate<Item> itemFilter, @Nullable Locale locale)
focal_class.identifier: map
focal_class.modifiers: private static
focal_class.parameters: (Item item, ItemDTO itemDTO, @Nullable UriBuilder uriBuilder, boolean drillDown,
              @Nullable Predicate<Item> itemFilter, @Nullable Locale locale)
focal_class.return: EnrichedItemDTO
focal_class.signature: EnrichedItemDTO map(Item item, ItemDTO itemDTO, @Nullable UriBuilder uriBuilder, boolean drillDown,
              @Nullable Predicate<Item> itemFilter, @Nullable Locale locale)
focal_class.class_method_signature: EnrichedItemDTOMapper.considerTransformation(@Nullable StateDescription stateDescription)
focal_class.full_signature: private static @Nullable StateDescription considerTransformation(@Nullable StateDescription stateDescription)
focal_class.identifier: considerTransformation
focal_class.modifiers: private static @Nullable
focal_class.parameters: (@Nullable StateDescription stateDescription)
focal_class.return: StateDescription
focal_class.signature: StateDescription considerTransformation(@Nullable StateDescription stateDescription)
focal_class.class_method_signature: EnrichedItemDTOMapper.considerTransformation(String state, Item item, @Nullable Locale locale)
focal_class.full_signature: private static @Nullable String considerTransformation(String state, Item item, @Nullable Locale locale)
focal_class.identifier: considerTransformation
focal_class.modifiers: private static @Nullable
focal_class.parameters: (String state, Item item, @Nullable Locale locale)
focal_class.return: String
focal_class.signature: String considerTransformation(String state, Item item, @Nullable Locale locale)
focal_method.body: public static EnrichedItemDTO map(Item item, boolean drillDown, @Nullable Predicate<Item> itemFilter,
              @Nullable UriBuilder uriBuilder, @Nullable Locale locale) {
          ItemDTO itemDTO = ItemDTOMapper.map(item);
          return map(item, itemDTO, uriBuilder, drillDown, itemFilter, locale);
      }
focal_method.class_method_signature: EnrichedItemDTOMapper.map(Item item, boolean drillDown, @Nullable Predicate<Item> itemFilter,
              @Nullable UriBuilder uriBuilder, @Nullable Locale locale)
focal_method.full_signature: public static EnrichedItemDTO map(Item item, boolean drillDown, @Nullable Predicate<Item> itemFilter,
              @Nullable UriBuilder uriBuilder, @Nullable Locale locale)
focal_method.identifier: map
focal_method.invocations: map map
focal_method.modifiers: public static
focal_method.parameters: (Item item, boolean drillDown, @Nullable Predicate<Item> itemFilter,
              @Nullable UriBuilder uriBuilder, @Nullable Locale locale)
focal_method.return: EnrichedItemDTO
focal_method.signature: EnrichedItemDTO map(Item item, boolean drillDown, @Nullable Predicate<Item> itemFilter,
              @Nullable UriBuilder uriBuilder, @Nullable Locale locale)