blob: d1cd7ba8f9ee0f4a2b5f391c7aed10cddc26559b (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
/*
* SPDX-FileCopyrightText: 2021-2023 The Refinery Authors <https://refinery.tools/>
*
* SPDX-License-Identifier: EPL-2.0
*/
package tools.refinery.store.query.dnf;
import tools.refinery.store.query.term.DataVariable;
public final class FunctionalQueryBuilder<T> extends AbstractQueryBuilder<FunctionalQueryBuilder<T>> {
private final DataVariable<T> outputVariable;
private final Class<T> type;
FunctionalQueryBuilder(DataVariable<T> outputVariable, DnfBuilder dnfBuilder, Class<T> type) {
super(dnfBuilder);
this.outputVariable = outputVariable;
this.type = type;
}
@Override
protected FunctionalQueryBuilder<T> self() {
return this;
}
public FunctionalQuery<T> build() {
dnfBuilder.output(outputVariable);
return dnfBuilder.build().asFunction(type);
}
}
|