diff options
Diffstat (limited to 'subprojects/store-reasoning/src/main/java/tools/refinery/store/reasoning/translator/containment/ContainmentInfo.java')
-rw-r--r-- | subprojects/store-reasoning/src/main/java/tools/refinery/store/reasoning/translator/containment/ContainmentInfo.java | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/subprojects/store-reasoning/src/main/java/tools/refinery/store/reasoning/translator/containment/ContainmentInfo.java b/subprojects/store-reasoning/src/main/java/tools/refinery/store/reasoning/translator/containment/ContainmentInfo.java new file mode 100644 index 00000000..e3457fa7 --- /dev/null +++ b/subprojects/store-reasoning/src/main/java/tools/refinery/store/reasoning/translator/containment/ContainmentInfo.java | |||
@@ -0,0 +1,24 @@ | |||
1 | /* | ||
2 | * SPDX-FileCopyrightText: 2023 The Refinery Authors <https://refinery.tools/> | ||
3 | * | ||
4 | * SPDX-License-Identifier: EPL-2.0 | ||
5 | */ | ||
6 | package tools.refinery.store.reasoning.translator.containment; | ||
7 | |||
8 | import tools.refinery.store.reasoning.representation.PartialRelation; | ||
9 | import tools.refinery.store.reasoning.translator.TranslationException; | ||
10 | import tools.refinery.store.reasoning.translator.multiplicity.Multiplicity; | ||
11 | |||
12 | public record ContainmentInfo(PartialRelation sourceType, Multiplicity multiplicity, | ||
13 | PartialRelation targetType) { | ||
14 | public ContainmentInfo { | ||
15 | if (sourceType.arity() != 1) { | ||
16 | throw new TranslationException(sourceType, "Expected source type %s to be of arity 1, got %d instead" | ||
17 | .formatted(sourceType, sourceType.arity())); | ||
18 | } | ||
19 | if (targetType.arity() != 1) { | ||
20 | throw new TranslationException(targetType, "Expected target type %s to be of arity 1, got %d instead" | ||
21 | .formatted(targetType, targetType.arity())); | ||
22 | } | ||
23 | } | ||
24 | } | ||