BenchmarkQuery.java
/*******************************************************************************
* Copyright (c) 2025 Eclipse RDF4J contributors.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Distribution License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/org/documents/edl-v10.php.
*
* SPDX-License-Identifier: BSD-3-Clause
*******************************************************************************/
// Some portions generated by Codex
package org.eclipse.rdf4j.benchmark.common;
import java.util.Objects;
public final class BenchmarkQuery {
private final String name;
private final String query;
private final long expectedCount;
public BenchmarkQuery(String name, String query, long expectedCount) {
this.name = requireNonBlank(name, "name");
this.query = requireNonBlank(query, "query");
if (expectedCount < 0) {
throw new IllegalArgumentException("expectedCount must be >= 0");
}
this.expectedCount = expectedCount;
}
public String getName() {
return name;
}
public String getQuery() {
return query;
}
public long getExpectedCount() {
return expectedCount;
}
private static String requireNonBlank(String value, String label) {
Objects.requireNonNull(value, label);
if (value.isBlank()) {
throw new IllegalArgumentException(label + " must not be blank");
}
return value;
}
}