Package org.drools.ruleunit
Interface DataSource<T>
-
- All Superinterfaces:
Iterable<T>
- All Known Subinterfaces:
InternalDataSource<T>
- All Known Implementing Classes:
CursoredDataSource
public interface DataSource<T> extends Iterable<T>
A DataSource is a source of the data processed by a givenRuleUnit
.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
DataSource.DataSourceFactory
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description static <T> DataSource<T>
create(T... items)
Creates a DataSource, optionally containing some itemsvoid
delete(Object object)
Deletes the given object from this DataSourcevoid
delete(org.kie.api.runtime.rule.FactHandle handle)
Deletes the fact for which the given FactHandle was assignedorg.kie.api.runtime.rule.FactHandle
insert(T object)
Inserts a new fact into this DataSourcevoid
update(org.kie.api.runtime.rule.FactHandle handle, T object, String... modifiedProperties)
Updates the fact for which the given FactHandle was assigned with the new fact set as the second parameter in this method.-
Methods inherited from interface java.lang.Iterable
forEach, iterator, spliterator
-
-
-
-
Method Detail
-
insert
org.kie.api.runtime.rule.FactHandle insert(T object)
Inserts a new fact into this DataSource- Parameters:
object
- the fact to be inserted- Returns:
- the fact handle created for the given fact
-
update
void update(org.kie.api.runtime.rule.FactHandle handle, T object, String... modifiedProperties)
Updates the fact for which the given FactHandle was assigned with the new fact set as the second parameter in this method. It is also possible to optionally specify the set of properties that have been modified.- Parameters:
handle
- the FactHandle for the fact to be updated.object
- the new value for the fact being updated.modifiedProperties
- the list of the names of the object's properties modified by this update.
-
delete
void delete(org.kie.api.runtime.rule.FactHandle handle)
Deletes the fact for which the given FactHandle was assigned- Parameters:
handle
- the handle whose fact is to be retracted.
-
delete
void delete(Object object)
Deletes the given object from this DataSource- Parameters:
object
- the object to be deleted.
-
create
static <T> DataSource<T> create(T... items)
Creates a DataSource, optionally containing some items- Parameters:
items
- the items contained in the DataSource.
-
-