All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.drools.compiler.kie.builder.impl.IncrementalResultsImpl Maven / Gradle / Ivy

There is a newer version: 10.0.0
Show newest version
package org.drools.compiler.kie.builder.impl;

import org.kie.internal.builder.IncrementalResults;
import org.kie.internal.builder.KnowledgeBuilderResult;
import org.kie.api.builder.Message;

import java.util.ArrayList;
import java.util.List;

public class IncrementalResultsImpl implements IncrementalResults {

    private long          idGenerator = 1L;

    private List addedMessages = new ArrayList();
    private List removedMessages = new ArrayList();

    @Override
    public List getAddedMessages() {
        return addedMessages;
    }

    @Override
    public List getRemovedMessages() {
        return removedMessages;
    }

    public void addMessage(KnowledgeBuilderResult result) {
        addedMessages.add( new MessageImpl( idGenerator++, result ) );
    }

    public void removeMessage(KnowledgeBuilderResult result) {
        removedMessages.add( new MessageImpl( idGenerator++, result ) );
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy