SammyVimes commented on a change in pull request #5:
URL: https://github.com/apache/ignite-3/pull/5#discussion_r535400429



##########
File path: 
modules/configuration/src/main/java/org/apache/ignite/configuration/internal/DynamicConfiguration.java
##########
@@ -0,0 +1,147 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.configuration.internal;
+
+import java.io.Serializable;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import org.apache.ignite.configuration.internal.property.DynamicProperty;
+import org.apache.ignite.configuration.internal.property.Modifier;
+import org.apache.ignite.configuration.internal.selector.BaseSelectors;
+import org.apache.ignite.configuration.internal.validation.FieldValidator;
+
+/**
+ * This class represents configuration root or node.
+ */
+public abstract class DynamicConfiguration<T, INIT, CHANGE> implements 
Modifier<T, INIT, CHANGE> {
+    /** Fully qualified name of the configuration. */
+    protected final String qualifiedName;
+
+    /** Configuration key. */
+    protected final String key;
+
+    /** Configuration prefix. */
+    protected final String prefix;
+
+    /** Configuration members (leafs and nodes). */
+    protected final Map<String, Modifier<?, ?, ?>> members = new HashMap<>();
+
+    /** Root configuration node. */
+    protected final DynamicConfiguration<?, ?, ?> root;
+
+    /** {@code true} if this is a member of {@link NamedListConfiguration}. */
+    protected final boolean isNamed;
+
+    /** Configurator that this configuration is attached to. */
+    protected final Configurator<? extends DynamicConfiguration<?, ?, ?>> 
configurator;
+
+    /**
+     * Constructor.
+     * @param prefix Configuration prefix.
+     * @param key Configuration key.
+     * @param isNamed Is this a part of named configuration.
+     * @param configurator Configurator that this object is attached to.
+     * @param root Root configuration.
+     */
+    protected DynamicConfiguration(
+        String prefix,
+        String key,
+        boolean isNamed,
+        Configurator<? extends DynamicConfiguration<?, ?, ?>> configurator,
+        DynamicConfiguration<?, ?, ?> root
+    ) {
+        this.prefix = prefix;
+        this.isNamed = isNamed;
+        this.configurator = configurator;
+
+        this.key = key;
+        if (root == null)
+            this.qualifiedName = key;
+        else {
+            if (isNamed)
+                qualifiedName = String.format("%s[%s]", prefix, key);

Review comment:
       Actually, we can't move past this formatting, as we need to differ 
static part of the name and  dynamic




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to