blob: c54cce2ff009f9e4b81237adbdb686d829dd2a99 (
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
|
/*
* SPDX-FileCopyrightText: 2021-2023 The Refinery Authors
*
* SPDX-License-Identifier: EPL-2.0
*/
package tools.refinery.store.query.view;
import java.util.List;
public record RelationViewImplication(AnyRelationView implyingRelationView, AnyRelationView impliedRelationView,
List<Integer> impliedIndices) {
public RelationViewImplication {
if (impliedIndices.size() != impliedRelationView.arity()) {
throw new IllegalArgumentException("Expected %d implied indices for %s, but %d are provided"
.formatted(impliedRelationView.arity(), impliedRelationView, impliedIndices.size()));
}
for (var index : impliedIndices) {
if (impliedRelationView.invalidIndex(index)) {
throw new IllegalArgumentException("%d is not a valid index for %s".formatted(index,
implyingRelationView));
}
}
}
}
|