Search in sources :

Example 46 with Predicate

use of java.util.function.Predicate in project pravega by pravega.

the class OperationMetadataUpdaterTests method testRollback.

/**
 * Tests the ability to rollback update transactions.
 */
@Test
public void testRollback() throws Exception {
    // 2 out of 3 UpdateTransactions are failed (to verify multi-failure).
    // Commit the rest and verify final metadata is as it should.
    final int failEvery = 3;
    Predicate<Integer> isIgnored = index -> index % failEvery > 0;
    Predicate<Integer> shouldFail = index -> index % failEvery == failEvery - 1;
    val referenceMetadata = createBlankMetadata();
    val metadata = createBlankMetadata();
    val updater = new OperationMetadataUpdater(metadata);
    val lastSegmentId = new AtomicLong(-1);
    val lastSegmentTxnId = new AtomicLong(-1);
    val updateTransactions = new ArrayList<Map.Entry<Long, ContainerMetadata>>();
    for (int i = 0; i < TRANSACTION_COUNT; i++) {
        // Check to see if this UpdateTransaction is going to end up being rolled back. If so, we should not update
        // the reference metadata at all.
        UpdateableContainerMetadata txnReferenceMetadata = isIgnored.test(i) ? null : referenceMetadata;
        populateUpdateTransaction(updater, txnReferenceMetadata, lastSegmentId, lastSegmentTxnId);
        if (shouldFail.test(i)) {
            long prevUtId = updateTransactions.get(updateTransactions.size() - 1).getKey();
            updater.rollback(prevUtId + 1);
        } else if (txnReferenceMetadata != null) {
            // Not failing and not ignored: this UpdateTransaction will survive, so record it.
            long utId = updater.sealTransaction();
            if (updateTransactions.size() > 0) {
                long prevUtId = updateTransactions.get(updateTransactions.size() - 1).getKey();
                Assert.assertEquals("Unexpected UpdateTransaction.Id.", prevUtId + failEvery - 1, utId);
            }
            updateTransactions.add(new AbstractMap.SimpleImmutableEntry<>(utId, clone(txnReferenceMetadata)));
        }
    }
    ContainerMetadata previousMetadata = null;
    for (val t : updateTransactions) {
        val utId = t.getKey();
        val expectedMetadata = t.getValue();
        // Check to see if it's time to commit.
        if (previousMetadata != null) {
            // Verify no changes to the metadata prior to commit.
            ContainerMetadataUpdateTransactionTests.assertMetadataSame("Before commit " + utId, previousMetadata, metadata);
        }
        // Commit and verify.
        updater.commit(utId);
        ContainerMetadataUpdateTransactionTests.assertMetadataSame("After commit " + utId, expectedMetadata, metadata);
        previousMetadata = expectedMetadata;
    }
}
Also used : Arrays(java.util.Arrays) StreamSegmentInformation(io.pravega.segmentstore.contracts.StreamSegmentInformation) ContainerMetadata(io.pravega.segmentstore.server.ContainerMetadata) HashMap(java.util.HashMap) LogAddress(io.pravega.segmentstore.storage.LogAddress) Supplier(java.util.function.Supplier) ArrayList(java.util.ArrayList) UpdateableContainerMetadata(io.pravega.segmentstore.server.UpdateableContainerMetadata) AttributeUpdate(io.pravega.segmentstore.contracts.AttributeUpdate) SegmentMetadata(io.pravega.segmentstore.server.SegmentMetadata) Map(java.util.Map) Timeout(org.junit.rules.Timeout) Operation(io.pravega.segmentstore.server.logs.operations.Operation) StreamSegmentMapOperation(io.pravega.segmentstore.server.logs.operations.StreamSegmentMapOperation) Attributes(io.pravega.segmentstore.contracts.Attributes) Predicate(java.util.function.Predicate) lombok.val(lombok.val) Test(org.junit.Test) UUID(java.util.UUID) AtomicLong(java.util.concurrent.atomic.AtomicLong) AbstractMap(java.util.AbstractMap) Rule(org.junit.Rule) StreamSegmentContainerMetadata(io.pravega.segmentstore.server.containers.StreamSegmentContainerMetadata) StreamSegmentAppendOperation(io.pravega.segmentstore.server.logs.operations.StreamSegmentAppendOperation) AttributeUpdateType(io.pravega.segmentstore.contracts.AttributeUpdateType) Assert(org.junit.Assert) MergeTransactionOperation(io.pravega.segmentstore.server.logs.operations.MergeTransactionOperation) StreamSegmentSealOperation(io.pravega.segmentstore.server.logs.operations.StreamSegmentSealOperation) lombok.val(lombok.val) ArrayList(java.util.ArrayList) UpdateableContainerMetadata(io.pravega.segmentstore.server.UpdateableContainerMetadata) ContainerMetadata(io.pravega.segmentstore.server.ContainerMetadata) UpdateableContainerMetadata(io.pravega.segmentstore.server.UpdateableContainerMetadata) StreamSegmentContainerMetadata(io.pravega.segmentstore.server.containers.StreamSegmentContainerMetadata) AtomicLong(java.util.concurrent.atomic.AtomicLong) AtomicLong(java.util.concurrent.atomic.AtomicLong) HashMap(java.util.HashMap) Map(java.util.Map) AbstractMap(java.util.AbstractMap) Test(org.junit.Test)

Example 47 with Predicate

use of java.util.function.Predicate in project pravega by pravega.

the class BookKeeperLogTests method testRemoveEmptyLedgers.

/**
 * Tests the ability of BookKeeperLog to automatically remove empty ledgers during initialization.
 */
@Test
public void testRemoveEmptyLedgers() throws Exception {
    final int count = 100;
    final int writeEvery = count / 10;
    final Predicate<Integer> shouldAppendAnything = i -> i % writeEvery == 0;
    val allLedgers = new ArrayList<Map.Entry<Long, LedgerMetadata.Status>>();
    final Predicate<Integer> shouldExist = index -> (index >= allLedgers.size() - Ledgers.MIN_FENCE_LEDGER_COUNT) || (allLedgers.get(index).getValue() != LedgerMetadata.Status.Empty);
    for (int i = 0; i < count; i++) {
        try (BookKeeperLog log = (BookKeeperLog) createDurableDataLog()) {
            log.initialize(TIMEOUT);
            boolean shouldAppend = shouldAppendAnything.test(i);
            val currentMetadata = log.loadMetadata();
            val lastLedger = currentMetadata.getLedgers().get(currentMetadata.getLedgers().size() - 1);
            allLedgers.add(new AbstractMap.SimpleImmutableEntry<>(lastLedger.getLedgerId(), shouldAppend ? LedgerMetadata.Status.NotEmpty : LedgerMetadata.Status.Empty));
            val metadataLedgers = currentMetadata.getLedgers().stream().map(LedgerMetadata::getLedgerId).collect(Collectors.toSet());
            // Verify Log Metadata does not contain old empty ledgers.
            for (int j = 0; j < allLedgers.size(); j++) {
                val e = allLedgers.get(j);
                val expectedExist = shouldExist.test(j);
                Assert.assertEquals("Unexpected state for metadata. AllLedgerCount=" + allLedgers.size() + ", LedgerIndex=" + j + ", LedgerStatus=" + e.getValue(), expectedExist, metadataLedgers.contains(e.getKey()));
            }
            // Append some data to this Ledger, if needed.
            if (shouldAppend) {
                log.append(new ByteArraySegment(getWriteData()), TIMEOUT).get(TIMEOUT.toMillis(), TimeUnit.MILLISECONDS);
            }
        }
    }
    // Verify that these ledgers have also been deleted from BookKeeper.
    for (int i = 0; i < allLedgers.size(); i++) {
        val e = allLedgers.get(i);
        if (shouldExist.test(i)) {
            // This should not throw any exceptions.
            Ledgers.openFence(e.getKey(), this.factory.get().getBookKeeperClient(), this.config.get());
        } else {
            AssertExtensions.assertThrows("Ledger not deleted from BookKeeper.", () -> Ledgers.openFence(e.getKey(), this.factory.get().getBookKeeperClient(), this.config.get()), ex -> true);
        }
    }
}
Also used : ObjectClosedException(io.pravega.common.ObjectClosedException) CuratorFrameworkFactory(org.apache.curator.framework.CuratorFrameworkFactory) BeforeClass(org.junit.BeforeClass) SneakyThrows(lombok.SneakyThrows) AssertExtensions(io.pravega.test.common.AssertExtensions) AtomicBoolean(java.util.concurrent.atomic.AtomicBoolean) Cleanup(lombok.Cleanup) CompletableFuture(java.util.concurrent.CompletableFuture) LogAddress(io.pravega.segmentstore.storage.LogAddress) AtomicReference(java.util.concurrent.atomic.AtomicReference) DataLogNotAvailableException(io.pravega.segmentstore.storage.DataLogNotAvailableException) ArrayList(java.util.ArrayList) AtomicInteger(java.util.concurrent.atomic.AtomicInteger) ExponentialBackoffRetry(org.apache.curator.retry.ExponentialBackoffRetry) Map(java.util.Map) After(org.junit.After) Timeout(org.junit.rules.Timeout) DurableDataLogException(io.pravega.segmentstore.storage.DurableDataLogException) Before(org.junit.Before) AfterClass(org.junit.AfterClass) DurableDataLog(io.pravega.segmentstore.storage.DurableDataLog) KeeperException(org.apache.zookeeper.KeeperException) CancellationException(java.util.concurrent.CancellationException) Predicate(java.util.function.Predicate) lombok.val(lombok.val) Test(org.junit.Test) Collectors(java.util.stream.Collectors) RetriesExhaustedException(io.pravega.common.util.RetriesExhaustedException) BKException(org.apache.bookkeeper.client.BKException) TimeUnit(java.util.concurrent.TimeUnit) AbstractMap(java.util.AbstractMap) List(java.util.List) CuratorFramework(org.apache.curator.framework.CuratorFramework) Rule(org.junit.Rule) ByteArraySegment(io.pravega.common.util.ByteArraySegment) DurableDataLogTestBase(io.pravega.segmentstore.storage.DurableDataLogTestBase) TreeMap(java.util.TreeMap) WriteFailureException(io.pravega.segmentstore.storage.WriteFailureException) TestUtils(io.pravega.test.common.TestUtils) Comparator(java.util.Comparator) Assert(org.junit.Assert) Futures(io.pravega.common.concurrent.Futures) lombok.val(lombok.val) ByteArraySegment(io.pravega.common.util.ByteArraySegment) ArrayList(java.util.ArrayList) AtomicInteger(java.util.concurrent.atomic.AtomicInteger) AbstractMap(java.util.AbstractMap) Map(java.util.Map) AbstractMap(java.util.AbstractMap) TreeMap(java.util.TreeMap) Test(org.junit.Test)

Example 48 with Predicate

use of java.util.function.Predicate in project SpongeCommon by SpongePowered.

the class SelectorResolver method makeFilter.

private Predicate<Entity> makeFilter() {
    // for easier reading
    final Selector sel = this.selector;
    Vector3d position = getPositionOrDefault(this.position, ArgumentTypes.POSITION);
    List<Predicate<Entity>> filters = Lists.newArrayList();
    addTypeFilters(filters);
    addDimensionFilters(position, filters);
    addRadiusFilters(position, filters);
    addLevelFilters(filters);
    addGamemodeFilters(filters);
    addNameFilters(filters);
    addRotationFilters(filters);
    addTeamFilters(filters);
    addScoreFilters(filters);
    SelectorType selectorType = sel.getType();
    Optional<Invertible<EntityType>> type = sel.getArgument(ArgumentTypes.ENTITY_TYPE);
    // isn't an ALL_ENTITIES selector or it is a RANDOM selector for only players
    boolean isPlayerOnlySelector = selectorType == SelectorTypes.ALL_PLAYERS || selectorType == SelectorTypes.NEAREST_PLAYER || (selectorType == SelectorTypes.RANDOM && type.isPresent() && !type.get().isInverted() && type.get().getValue() != EntityTypes.PLAYER);
    if (isPlayerOnlySelector) {
        // insert at the start so it applies first
        filters.add(0, requireTypePredicate(Entity.class, Player.class));
    }
    return Functional.predicateAnd(filters);
}
Also used : Entity(org.spongepowered.api.entity.Entity) Player(org.spongepowered.api.entity.living.player.Player) Vector3d(com.flowpowered.math.vector.Vector3d) SelectorType(org.spongepowered.api.text.selector.SelectorType) Invertible(org.spongepowered.api.text.selector.Argument.Invertible) Selector(org.spongepowered.api.text.selector.Selector) Predicate(java.util.function.Predicate)

Example 49 with Predicate

use of java.util.function.Predicate in project alf.io by alfio-event.

the class EventApiController method downloadAllTicketsCSV.

@RequestMapping("/events/{eventName}/export.csv")
public void downloadAllTicketsCSV(@PathVariable("eventName") String eventName, HttpServletRequest request, HttpServletResponse response, Principal principal) throws IOException {
    List<String> fields = Arrays.asList(Optional.ofNullable(request.getParameterValues("fields")).orElse(new String[] {}));
    Event event = loadEvent(eventName, principal);
    Map<Integer, TicketCategory> categoriesMap = eventManager.loadTicketCategories(event).stream().collect(Collectors.toMap(TicketCategory::getId, Function.identity()));
    ZoneId eventZoneId = event.getZoneId();
    Predicate<String> contains = FIXED_FIELDS::contains;
    response.setContentType("text/csv;charset=UTF-8");
    response.setHeader("Content-Disposition", "attachment; filename=" + eventName + "-export.csv");
    try (ServletOutputStream out = response.getOutputStream();
        CSVWriter writer = new CSVWriter(new OutputStreamWriter(out))) {
        for (int marker : BOM_MARKERS) {
            // UGLY-MODE_ON: specify that the file is written in UTF-8 with BOM, thanks to alexr http://stackoverflow.com/a/4192897
            out.write(marker);
        }
        writer.writeNext(fields.stream().map(f -> {
            if (f.startsWith(CUSTOM_FIELDS_PREFIX)) {
                return f.substring(CUSTOM_FIELDS_PREFIX.length());
            }
            return f;
        }).toArray(String[]::new));
        eventManager.findAllConfirmedTicketsForCSV(eventName, principal.getName()).stream().map(t -> {
            List<String> line = new ArrayList<>();
            if (fields.contains("ID")) {
                line.add(t.getUuid());
            }
            if (fields.contains("Creation")) {
                line.add(t.getCreation().withZoneSameInstant(eventZoneId).toString());
            }
            if (fields.contains("Category")) {
                line.add(categoriesMap.get(t.getCategoryId()).getName());
            }
            if (fields.contains("Event")) {
                line.add(eventName);
            }
            if (fields.contains("Status")) {
                line.add(t.getStatus().toString());
            }
            if (fields.contains("OriginalPrice")) {
                line.add(MonetaryUtil.centsToUnit(t.getSrcPriceCts()).toString());
            }
            if (fields.contains("PaidPrice")) {
                line.add(MonetaryUtil.centsToUnit(t.getFinalPriceCts()).toString());
            }
            if (fields.contains("Discount")) {
                line.add(MonetaryUtil.centsToUnit(t.getDiscountCts()).toString());
            }
            if (fields.contains("VAT")) {
                line.add(MonetaryUtil.centsToUnit(t.getVatCts()).toString());
            }
            if (fields.contains("ReservationID")) {
                line.add(t.getTicketsReservationId());
            }
            if (fields.contains("Full Name")) {
                line.add(t.getFullName());
            }
            if (fields.contains("First Name")) {
                line.add(t.getFirstName());
            }
            if (fields.contains("Last Name")) {
                line.add(t.getLastName());
            }
            if (fields.contains("E-Mail")) {
                line.add(t.getEmail());
            }
            if (fields.contains("Locked")) {
                line.add(String.valueOf(t.getLockedAssignment()));
            }
            if (fields.contains("Language")) {
                line.add(String.valueOf(t.getUserLanguage()));
            }
            if (fields.contains("Confirmation")) {
                line.add(t.getTicketReservation().getConfirmationTimestamp().withZoneSameInstant(eventZoneId).toString());
            }
            if (fields.contains("Billing Address")) {
                line.add(t.getTicketReservation().getBillingAddress());
            }
            // obviously not optimized
            Map<String, String> additionalValues = ticketFieldRepository.findAllValuesForTicketId(t.getId());
            fields.stream().filter(contains.negate()).filter(f -> f.startsWith(CUSTOM_FIELDS_PREFIX)).forEachOrdered(field -> {
                String customFieldName = field.substring(CUSTOM_FIELDS_PREFIX.length());
                line.add(additionalValues.getOrDefault(customFieldName, "").replaceAll("\"", ""));
            });
            return line.toArray(new String[line.size()]);
        }).forEachOrdered(writer::writeNext);
        writer.flush();
        out.flush();
    }
}
Also used : alfio.manager(alfio.manager) TemplateProcessor(alfio.controller.support.TemplateProcessor) StringUtils(org.apache.commons.lang3.StringUtils) BigDecimal(java.math.BigDecimal) Json(alfio.util.Json) Model(org.springframework.ui.Model) Pair(org.apache.commons.lang3.tuple.Pair) AtomicInteger(java.util.concurrent.atomic.AtomicInteger) SponsorScanRepository(alfio.repository.SponsorScanRepository) ParseException(java.text.ParseException) Triple(org.apache.commons.lang3.tuple.Triple) ZipEntry(java.util.zip.ZipEntry) DateFormat(java.text.DateFormat) PageAndContent(alfio.controller.api.support.PageAndContent) TicketCategoryDescriptionRepository(alfio.repository.TicketCategoryDescriptionRepository) Organization(alfio.model.user.Organization) Predicate(java.util.function.Predicate) TemplateManager(alfio.util.TemplateManager) RequestMethod(org.springframework.web.bind.annotation.RequestMethod) Collectors(java.util.stream.Collectors) ZoneId(java.time.ZoneId) DynamicFieldTemplateRepository(alfio.repository.DynamicFieldTemplateRepository) Role(alfio.model.user.Role) Principal(java.security.Principal) alfio.model(alfio.model) org.springframework.web.bind.annotation(org.springframework.web.bind.annotation) alfio.model.modification(alfio.model.modification) OptionalWrapper.optionally(alfio.util.OptionalWrapper.optionally) ValidationResult(alfio.model.result.ValidationResult) ZipOutputStream(java.util.zip.ZipOutputStream) DataAccessException(org.springframework.dao.DataAccessException) Errors(org.springframework.validation.Errors) java.util(java.util) TicketHelper(alfio.controller.api.support.TicketHelper) Getter(lombok.Getter) EventListItem(alfio.controller.api.support.EventListItem) CSVReader(com.opencsv.CSVReader) SimpleDateFormat(java.text.SimpleDateFormat) Function(java.util.function.Function) TicketFieldRepository(alfio.repository.TicketFieldRepository) HttpServletRequest(javax.servlet.http.HttpServletRequest) ServletOutputStream(javax.servlet.ServletOutputStream) OutputStreamWriter(java.io.OutputStreamWriter) StreamUtils(org.springframework.util.StreamUtils) OutputStream(java.io.OutputStream) HttpServletResponse(javax.servlet.http.HttpServletResponse) CSVWriter(com.opencsv.CSVWriter) IOException(java.io.IOException) Validator(alfio.util.Validator) InputStreamReader(java.io.InputStreamReader) DateUtils(org.apache.commons.lang3.time.DateUtils) HttpStatus(org.springframework.http.HttpStatus) Collectors.toList(java.util.stream.Collectors.toList) Validate(org.apache.commons.lang3.Validate) MonetaryUtil(alfio.util.MonetaryUtil) UserManager(alfio.manager.user.UserManager) Log4j2(lombok.extern.log4j.Log4j2) ResponseEntity(org.springframework.http.ResponseEntity) I18nManager(alfio.manager.i18n.I18nManager) DescriptionsLoader(alfio.controller.api.support.DescriptionsLoader) AllArgsConstructor(lombok.AllArgsConstructor) ZoneId(java.time.ZoneId) ServletOutputStream(javax.servlet.ServletOutputStream) CSVWriter(com.opencsv.CSVWriter) AtomicInteger(java.util.concurrent.atomic.AtomicInteger) OutputStreamWriter(java.io.OutputStreamWriter) Collectors.toList(java.util.stream.Collectors.toList)

Example 50 with Predicate

use of java.util.function.Predicate in project kie-wb-common by kiegroup.

the class BaseExpressionGrid method executeRenderQueueCommands.

@Override
protected void executeRenderQueueCommands(final boolean isSelectionLayer) {
    final List<Pair<Group, GridRenderer.RendererCommand>> gridLineCommands = new ArrayList<>();
    final List<Pair<Group, GridRenderer.RendererCommand>> allOtherCommands = new ArrayList<>();
    final List<Pair<Group, GridRenderer.RendererCommand>> selectedCellsCommands = new ArrayList<>();
    for (Pair<Group, List<GridRenderer.RendererCommand>> p : renderQueue) {
        final Group parent = p.getK1();
        final List<GridRenderer.RendererCommand> commands = p.getK2();
        for (GridRenderer.RendererCommand command : commands) {
            if (command instanceof GridRenderer.RenderSelectedCellsCommand) {
                selectedCellsCommands.add(new Pair<>(parent, command));
            } else if (command instanceof GridRenderer.RenderHeaderGridLinesCommand) {
                gridLineCommands.add(new Pair<>(parent, command));
            } else if (command instanceof GridRenderer.RenderBodyGridLinesCommand) {
                gridLineCommands.add(new Pair<>(parent, command));
            } else {
                allOtherCommands.add(new Pair<>(parent, command));
            }
        }
    }
    final Predicate<Pair<Group, GridRenderer.RendererCommand>> renderHeader = (p) -> {
        final GridRenderer.RendererCommand command = p.getK2();
        if (isHeaderHidden()) {
            return !(command instanceof GridRenderer.RendererHeaderCommand);
        }
        return true;
    };
    renderQueue.clear();
    allOtherCommands.stream().filter(renderHeader).forEach(p -> addCommandToRenderQueue(p.getK1(), p.getK2()));
    gridLineCommands.stream().filter(renderHeader).forEach(p -> addCommandToRenderQueue(p.getK1(), p.getK2()));
    selectedCellsCommands.stream().filter(renderHeader).forEach(p -> addCommandToRenderQueue(p.getK1(), p.getK2()));
    super.executeRenderQueueCommands(isSelectionLayer);
}
Also used : TextAreaSingletonDOMElementFactory(org.kie.workbench.common.dmn.client.widgets.grid.columns.factory.TextAreaSingletonDOMElementFactory) CellEditorControlsView(org.kie.workbench.common.dmn.client.widgets.grid.controls.container.CellEditorControlsView) DefinitionUtils(org.kie.workbench.common.stunner.core.util.DefinitionUtils) ListSelectorView(org.kie.workbench.common.dmn.client.widgets.grid.controls.list.ListSelectorView) DMNGridLayer(org.kie.workbench.common.dmn.client.widgets.layer.DMNGridLayer) GridColumn(org.uberfire.ext.wires.core.grids.client.model.GridColumn) Group(com.ait.lienzo.client.core.shape.Group) GridSelectionManager(org.uberfire.ext.wires.core.grids.client.widget.layer.GridSelectionManager) BaseGridWidget(org.uberfire.ext.wires.core.grids.client.widget.grid.impl.BaseGridWidget) GridLayerRedrawManager(org.uberfire.ext.wires.core.grids.client.widget.layer.impl.GridLayerRedrawManager) SetHeaderValueCommand(org.kie.workbench.common.dmn.client.commands.general.SetHeaderValueCommand) Layer(com.ait.lienzo.client.core.shape.Layer) SetCellValueCommand(org.kie.workbench.common.dmn.client.commands.general.SetCellValueCommand) DeleteHeaderValueCommand(org.kie.workbench.common.dmn.client.commands.general.DeleteHeaderValueCommand) CanvasCommandFactory(org.kie.workbench.common.stunner.core.client.command.CanvasCommandFactory) Predicate(java.util.function.Predicate) GridDataCache(org.kie.workbench.common.dmn.client.widgets.grid.model.GridDataCache) AbstractCanvasHandler(org.kie.workbench.common.stunner.core.client.canvas.AbstractCanvasHandler) AbstractCanvasGraphCommand(org.kie.workbench.common.stunner.core.client.canvas.command.AbstractCanvasGraphCommand) DeleteCellValueCommand(org.kie.workbench.common.dmn.client.commands.general.DeleteCellValueCommand) GridWidget(org.uberfire.ext.wires.core.grids.client.widget.grid.GridWidget) HasName(org.kie.workbench.common.dmn.api.definition.HasName) List(java.util.List) TextBoxSingletonDOMElementFactory(org.kie.workbench.common.dmn.client.widgets.grid.columns.factory.TextBoxSingletonDOMElementFactory) Optional(java.util.Optional) EditableHeaderGridWidgetMouseDoubleClickHandler(org.kie.workbench.common.dmn.client.widgets.grid.columns.EditableHeaderGridWidgetMouseDoubleClickHandler) Viewport(com.ait.lienzo.client.core.shape.Viewport) GridRenderer(org.uberfire.ext.wires.core.grids.client.widget.grid.renderers.grids.GridRenderer) Function(java.util.function.Function) ArrayList(java.util.ArrayList) RowNumberColumn(org.uberfire.ext.wires.core.grids.client.widget.grid.columns.RowNumberColumn) HasExpression(org.kie.workbench.common.dmn.api.definition.HasExpression) GridCellTuple(org.kie.workbench.common.dmn.client.widgets.grid.model.GridCellTuple) Element(org.kie.workbench.common.stunner.core.graph.Element) Command(org.kie.workbench.common.stunner.core.command.Command) Expression(org.kie.workbench.common.dmn.api.definition.v1_1.Expression) SessionManager(org.kie.workbench.common.stunner.core.client.api.SessionManager) Pair(org.uberfire.commons.data.Pair) BaseUIModelMapper(org.kie.workbench.common.dmn.client.widgets.grid.model.BaseUIModelMapper) DMNGridPanel(org.kie.workbench.common.dmn.client.widgets.panel.DMNGridPanel) CanvasViolation(org.kie.workbench.common.stunner.core.client.command.CanvasViolation) TranslationService(org.jboss.errai.ui.client.local.spi.TranslationService) GridData(org.uberfire.ext.wires.core.grids.client.model.GridData) EditableHeaderMetaData(org.kie.workbench.common.dmn.client.widgets.grid.columns.EditableHeaderMetaData) SessionCommandManager(org.kie.workbench.common.stunner.core.client.command.SessionCommandManager) Definition(org.kie.workbench.common.stunner.core.graph.content.definition.Definition) GridPinnedModeManager(org.uberfire.ext.wires.core.grids.client.widget.layer.pinning.GridPinnedModeManager) NodeMouseDoubleClickHandler(com.ait.lienzo.client.core.event.NodeMouseDoubleClickHandler) INodeXYEvent(com.ait.lienzo.client.core.event.INodeXYEvent) GridCellValueTuple(org.kie.workbench.common.dmn.client.widgets.grid.model.GridCellValueTuple) CompositeCommand(org.kie.workbench.common.stunner.core.command.impl.CompositeCommand) Group(com.ait.lienzo.client.core.shape.Group) ArrayList(java.util.ArrayList) List(java.util.List) ArrayList(java.util.ArrayList) GridRenderer(org.uberfire.ext.wires.core.grids.client.widget.grid.renderers.grids.GridRenderer) Pair(org.uberfire.commons.data.Pair)

Aggregations

Predicate (java.util.function.Predicate)589 List (java.util.List)266 ArrayList (java.util.ArrayList)170 Collectors (java.util.stream.Collectors)167 Map (java.util.Map)164 Set (java.util.Set)137 Test (org.junit.Test)133 IOException (java.io.IOException)122 Collections (java.util.Collections)118 Arrays (java.util.Arrays)110 HashMap (java.util.HashMap)105 Collection (java.util.Collection)93 Optional (java.util.Optional)87 HashSet (java.util.HashSet)85 Stream (java.util.stream.Stream)69 Function (java.util.function.Function)61 File (java.io.File)60 Iterator (java.util.Iterator)55 Logger (org.slf4j.Logger)53 LoggerFactory (org.slf4j.LoggerFactory)52