Skip to content

Package: RuntimeConfiguration

RuntimeConfiguration

nameinstructionbranchcomplexitylinemethod
RuntimeConfiguration(DriverConfiguration)
M: 7 C: 22
76%
M: 0 C: 2
100%
M: 0 C: 2
100%
M: 2 C: 7
78%
M: 0 C: 1
100%
getLoadAllThreshold()
M: 0 C: 3
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
getStatementLoaderFactory()
M: 0 C: 3
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
setStatementLoaderFactory(StatementLoaderFactory)
M: 4 C: 7
64%
M: 1 C: 1
50%
M: 1 C: 1
50%
M: 0 C: 3
100%
M: 0 C: 1
100%
static {...}
M: 0 C: 1
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%

Coverage

1: /*
2: * JOPA
3: * Copyright (C) 2024 Czech Technical University in Prague
4: *
5: * This library is free software; you can redistribute it and/or
6: * modify it under the terms of the GNU Lesser General Public
7: * License as published by the Free Software Foundation; either
8: * version 3.0 of the License, or (at your option) any later version.
9: *
10: * This library is distributed in the hope that it will be useful,
11: * but WITHOUT ANY WARRANTY; without even the implied warranty of
12: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13: * Lesser General Public License for more details.
14: *
15: * You should have received a copy of the GNU Lesser General Public
16: * License along with this library.
17: */
18: package cz.cvut.kbss.ontodriver.rdf4j.config;
19:
20: import cz.cvut.kbss.ontodriver.config.DriverConfiguration;
21: import cz.cvut.kbss.ontodriver.rdf4j.loader.DefaultStatementLoaderFactory;
22: import cz.cvut.kbss.ontodriver.rdf4j.loader.StatementLoaderFactory;
23:
24: /**
25: * Represents configuration which influences the driver during its active usage, not its initialization.
26: */
27: public class RuntimeConfiguration {
28:
29: private final int loadAllThreshold;
30:
31: private StatementLoaderFactory statementLoaderFactory = new DefaultStatementLoaderFactory();
32:
33: public RuntimeConfiguration(DriverConfiguration config) {
34:• if (config.isSet(Rdf4jConfigParam.LOAD_ALL_THRESHOLD)) {
35: try {
36: this.loadAllThreshold = Integer.parseInt(config.getProperty(Rdf4jConfigParam.LOAD_ALL_THRESHOLD));
37: } catch (NumberFormatException e) {
38: throw new IllegalArgumentException(
39: "Invalid value of the \"" + Rdf4jOntoDriverProperties.LOAD_ALL_THRESHOLD +
40: "\" parameter. Must be a valid integer.", e);
41: }
42: } else {
43: this.loadAllThreshold = Constants.DEFAULT_LOAD_ALL_THRESHOLD;
44: }
45: }
46:
47: public int getLoadAllThreshold() {
48: return loadAllThreshold;
49: }
50:
51: public StatementLoaderFactory getStatementLoaderFactory() {
52: return statementLoaderFactory;
53: }
54:
55: public void setStatementLoaderFactory(StatementLoaderFactory statementLoaderFactory) {
56:• assert statementLoaderFactory != null;
57: this.statementLoaderFactory = statementLoaderFactory;
58: }
59: }