@Test public void testIsPropertyTypePresent() { final String someBuiltInType = BuiltInType.STRING.getName(); final String anImportedType = "SomeImportedType"; final String unknownType = "UnknownType"; final DataObject dataObject = mock(DataObject.class); when(dataObject.getClassType()).thenReturn(anImportedType); final List<DataObject> imported = Arrays.asList(dataObject); boolean isPresent = dataTypeList.isPropertyTypePresent(someBuiltInType, imported); assertTrue("Built-in type is present", isPresent); isPresent = dataTypeList.isPropertyTypePresent(anImportedType, imported); assertTrue("Imported type is present", isPresent); isPresent = dataTypeList.isPropertyTypePresent(unknownType, imported); assertFalse("Type not imported or not built-in is not present", isPresent); }
boolean isPropertyTypePresent(final String type, final List<DataObject> imported) { return BuiltInTypeUtils.isBuiltInType(type) || imported.stream().anyMatch(dataObject -> Objects.equals(dataObject.getClassType(), type)); }
DataTypeList { boolean isPropertyTypePresent(final String type, final List<DataObject> imported) { return BuiltInTypeUtils.isBuiltInType(type) || imported.stream().anyMatch(dataObject -> Objects.equals(dataObject.getClassType(), type)); } }
DataTypeList { boolean isPropertyTypePresent(final String type, final List<DataObject> imported) { return BuiltInTypeUtils.isBuiltInType(type) || imported.stream().anyMatch(dataObject -> Objects.equals(dataObject.getClassType(), type)); } @Inject  DataTypeList(final View view,
                        final ManagedInstance<DataTypeListItem> listItems,
                        final DataTypeManager dataTypeManager,
                        final DataTypeSearchBar searchBar,
                        final DNDListComponent dndListComponent,
                        final DataTypeStackHash dataTypeStackHash,
                        final DNDDataTypesHandler dndDataTypesHandler,
                        final DataTypeListHighlightHelper highlightHelper,
                        final IsKogito isKogito); }
DataTypeList { boolean isPropertyTypePresent(final String type, final List<DataObject> imported) { return BuiltInTypeUtils.isBuiltInType(type) || imported.stream().anyMatch(dataObject -> Objects.equals(dataObject.getClassType(), type)); } @Inject  DataTypeList(final View view,
                        final ManagedInstance<DataTypeListItem> listItems,
                        final DataTypeManager dataTypeManager,
                        final DataTypeSearchBar searchBar,
                        final DNDListComponent dndListComponent,
                        final DataTypeStackHash dataTypeStackHash,
                        final DNDDataTypesHandler dndDataTypesHandler,
                        final DataTypeListHighlightHelper highlightHelper,
                        final IsKogito isKogito); HTMLElement getElement(); void setupItems(final List<DataType> dataTypes); Optional<DataTypeListItem> findItem(final DataType dataType); DNDListComponent getDNDListComponent(); List<DataTypeListItem> getItems(); void showNoDataTypesFound(); void showListItems(); void collapseAll(); void enableEditMode(final String dataTypeHash); void registerDataTypeListItemUpdateCallback(final Consumer<DataTypeListItem> onDataTypeListItemUpdate); Optional<DataTypeListItem> findItemByDataTypeHash(final String dataTypeHash); String calculateHash(final DataType dataType); void onDataTypeEditModeToggle(final @Observes DataTypeEditModeToggleEvent event); HTMLElement getListItems(); void importDataObjects(final List<DataObject> selectedDataObjects); void disableEditModeForChildren(final DataTypeListItem dataTypeListItem); List<String> getExistingDataTypesNames(); void highlightLevel(final DataType dataType); void highlightLevel(final Element element); void highlight(final Element element); void cleanLevelHighlightClass(); void cleanHighlightClass(); }
DataTypeList { boolean isPropertyTypePresent(final String type, final List<DataObject> imported) { return BuiltInTypeUtils.isBuiltInType(type) || imported.stream().anyMatch(dataObject -> Objects.equals(dataObject.getClassType(), type)); } @Inject  DataTypeList(final View view,
                        final ManagedInstance<DataTypeListItem> listItems,
                        final DataTypeManager dataTypeManager,
                        final DataTypeSearchBar searchBar,
                        final DNDListComponent dndListComponent,
                        final DataTypeStackHash dataTypeStackHash,
                        final DNDDataTypesHandler dndDataTypesHandler,
                        final DataTypeListHighlightHelper highlightHelper,
                        final IsKogito isKogito); HTMLElement getElement(); void setupItems(final List<DataType> dataTypes); Optional<DataTypeListItem> findItem(final DataType dataType); DNDListComponent getDNDListComponent(); List<DataTypeListItem> getItems(); void showNoDataTypesFound(); void showListItems(); void collapseAll(); void enableEditMode(final String dataTypeHash); void registerDataTypeListItemUpdateCallback(final Consumer<DataTypeListItem> onDataTypeListItemUpdate); Optional<DataTypeListItem> findItemByDataTypeHash(final String dataTypeHash); String calculateHash(final DataType dataType); void onDataTypeEditModeToggle(final @Observes DataTypeEditModeToggleEvent event); HTMLElement getListItems(); void importDataObjects(final List<DataObject> selectedDataObjects); void disableEditModeForChildren(final DataTypeListItem dataTypeListItem); List<String> getExistingDataTypesNames(); void highlightLevel(final DataType dataType); void highlightLevel(final Element element); void highlight(final Element element); void cleanLevelHighlightClass(); void cleanHighlightClass();  }