Class ReadWriteDataCollectionBuilder<W extends QueryableData & Writable>
java.lang.Object
fr.inria.rules.integraal.model.data.collection.builder.ReadWriteDataCollectionBuilder<W>
- Type Parameters:
W- the type of Writable data associated with the collection, which also extends Q
A builder for creating read-write data collections.
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a read-write data collection builder. -
Method Summary
Modifier and TypeMethodDescriptionaddQueryableData(QueryableData queryableData) Adds a QueryableData instance with all its predicates.addQueryableData(Predicate predicate, QueryableData queryableData) Adds a QueryableData instance associated with a specific Predicate.addQueryableWritableData(Predicate predicate, W writableData) Adds a Writable instance, which is also Queryable, associated with a specific Predicate.<T extends QueryableData>
QueryableWritableDataCollection<T, W> build()Builds a QueryableWritableDataCollection instance from the added data.<T extends MaterializedData>
MaterializedWritableDataCollection<T, W> Builds a MaterializedWritableDataCollection instance if the type supports MaterializedData.setDefaultWritableData(W writableData) Sets the default Writable instance.
-
Constructor Details
-
ReadWriteDataCollectionBuilder
public ReadWriteDataCollectionBuilder()Creates a read-write data collection builder.
-
-
Method Details
-
addQueryableData
public ReadWriteDataCollectionBuilder<W> addQueryableData(Predicate predicate, QueryableData queryableData) Adds a QueryableData instance associated with a specific Predicate.- Parameters:
predicate- the predicate associated with the QueryableDataqueryableData- the QueryableData to be added- Returns:
- this builder instance for chaining
- Throws:
IllegalArgumentException- if the predicate is not present in the QueryableDataIllegalStateException- if the predicate is already associated with another QueryableData
-
addQueryableData
Adds a QueryableData instance with all its predicates.- Parameters:
queryableData- the QueryableData to be added- Returns:
- this builder instance for chaining
- Throws:
IllegalStateException- if any predicate is already associated with another QueryableData
-
addQueryableWritableData
public ReadWriteDataCollectionBuilder<W> addQueryableWritableData(Predicate predicate, W writableData) Adds a Writable instance, which is also Queryable, associated with a specific Predicate.- Parameters:
predicate- the predicate associated with the writable datawritableData- the writable/queryable data to register- Returns:
- this builder instance for chaining
-
setDefaultWritableData
Sets the default Writable instance.- Parameters:
writableData- the default writable/queryable data- Returns:
- this builder instance for chaining
-
build
Builds a QueryableWritableDataCollection instance from the added data.- Type Parameters:
T- the queryable view type exposed by the built collection- Returns:
- a new queryable/writable data collection
-
buildMaterialized
Builds a MaterializedWritableDataCollection instance if the type supports MaterializedData.- Type Parameters:
T- the materialized queryable view type exposed by the built collection- Returns:
- a new materialized writable data collection
-