File tree Expand file tree Collapse file tree
core/sail/fts/lucene-spin/src/main/java/org/eclipse/rdf4j/lucene/spin Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1616import java .util .Map ;
1717import java .util .Properties ;
1818import java .util .Set ;
19+ import java .util .function .BiConsumer ;
1920import org .eclipse .rdf4j .model .IRI ;
2021import org .eclipse .rdf4j .model .Statement ;
2122import org .eclipse .rdf4j .model .ValueFactory ;
@@ -62,10 +63,31 @@ public Properties getParameters() {
6263 return parameters ;
6364 }
6465
66+ /**
67+ * Replaces existing parameters.
68+ * <p>
69+ * By default parameters field is instantiated in constructor. Using this method replaces the existing
70+ * field. If you wish only add missing parameters use {@link #addAbsentParameters(java.util.Properties)}.
71+ * </p>
72+ *
73+ * @param parameters
74+ */
6575 public void setParameters (Properties parameters ) {
6676 this .parameters = parameters ;
6777 }
6878
79+ /**
80+ * Add only absent parameters from argument.
81+ *
82+ * @see Properties#putIfAbsent(java.lang.Object, java.lang.Object)
83+ * @param parameters
84+ */
85+ public void addAbsentParameters (Properties parameters ) {
86+ parameters .forEach ((Object k , Object v ) -> {
87+ LuceneSpinSail .this .parameters .putIfAbsent (k , v );
88+ });
89+ }
90+
6991 /**
7092 * @throws SailException
7193 */
You can’t perform that action at this time.
0 commit comments