aboutsummaryrefslogtreecommitdiffstats
path: root/subprojects/store-query-viatra/src/test/java/tools/refinery/store/query/viatra/tests/QueryBackendHint.java
blob: 5f88e04bd4fefe4c357f1ef0d2f4c81a17c616bb (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
/*
 * SPDX-FileCopyrightText: 2021-2023 The Refinery Authors <https://refinery.tools/>
 *
 * SPDX-License-Identifier: EPL-2.0
 */
package tools.refinery.store.query.viatra.tests;

import tools.refinery.viatra.runtime.matchers.backend.QueryEvaluationHint;

/**
 * Overrides {@link QueryEvaluationHint#toString()} for pretty names in parametric test names.
 */
class QueryBackendHint extends QueryEvaluationHint {
	public QueryBackendHint(BackendRequirement backendRequirementType) {
		super(null, backendRequirementType);
	}

	@Override
	public String toString() {
		return switch (getQueryBackendRequirementType()) {
			case UNSPECIFIED -> "default";
			case DEFAULT_CACHING -> "incremental";
			case DEFAULT_SEARCH -> "localSearch";
			default -> throw new IllegalStateException("Unknown BackendRequirement");
		};
	}
}