Class ReadOnlyDataCollectionBuilder<T extends QueryableData>
java.lang.Object
fr.inria.rules.integraal.model.data.collection.builder.ReadOnlyDataCollectionBuilder<T>
- Type Parameters:
T- the type of QueryableData to be stored in the collection
A builder for creating read-only data collections.
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a read-only data collection builder. -
Method Summary
Modifier and TypeMethodDescriptionaddQueryableData(Predicate predicate, T queryableData) Adds a QueryableData instance associated with a specific Predicate.addQueryableData(Collection<Predicate> predicates, T queryableData) Adds a QueryableData instance with specific predicatesaddQueryableData(T queryableData) Adds a QueryableData instance with all its predicates.build()Builds a QueryableDataCollection instance from the added QueryableData.Builds a MaterializedDataCollection instance if the type supports MaterializedData.
-
Constructor Details
-
ReadOnlyDataCollectionBuilder
public ReadOnlyDataCollectionBuilder()Creates a read-only data collection builder.
-
-
Method Details
-
addQueryableData
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
-
addQueryableData
public ReadOnlyDataCollectionBuilder<T> addQueryableData(Collection<Predicate> predicates, T queryableData) Adds a QueryableData instance with specific predicates- Parameters:
predicates- the predicates associated with the QueryableDataqueryableData- the QueryableData to be added- Returns:
- this builder instance for chaining
- Throws:
IllegalStateException- if any predicate is already associated with another QueryableData
-
build
Builds a QueryableDataCollection instance from the added QueryableData.- Returns:
- an immutable QueryableDataCollection instance
-
buildMaterialized
Builds a MaterializedDataCollection instance if the type supports MaterializedData.- Returns:
- an immutable MaterializedDataCollection instance
- Throws:
IllegalStateException- if the type is not assignable to MaterializedData
-