This is an automated email from the ASF dual-hosted git repository.

chengzhang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/shardingsphere.git


The following commit(s) were added to refs/heads/master by this push:
     new d9e2d862ad2 Add default value on RepositoryTupleField, do not need 
config if same value and field name (#31155)
d9e2d862ad2 is described below

commit d9e2d862ad2608352e5dc111f01ae8f6cc1d9eaa
Author: Liang Zhang <[email protected]>
AuthorDate: Tue May 7 13:25:13 2024 +0800

    Add default value on RepositoryTupleField, do not need config if same value 
and field name (#31155)
---
 .../config/YamlBroadcastRuleConfiguration.java     |  5 ++-
 .../yaml/config/YamlEncryptRuleConfiguration.java  |  7 ++--
 .../yaml/config/YamlMaskRuleConfiguration.java     |  5 ++-
 .../YamlReadwriteSplittingRuleConfiguration.java   |  2 +-
 .../yaml/config/YamlShadowRuleConfiguration.java   |  4 +--
 .../yaml/config/YamlShardingRuleConfiguration.java | 22 ++++++------
 .../pojo/rule/annotation/RepositoryTupleField.java |  2 +-
 .../mode/engine/RepositoryTupleSwapperEngine.java  | 40 +++++++++++++---------
 8 files changed, 45 insertions(+), 42 deletions(-)

diff --git 
a/features/broadcast/core/src/main/java/org/apache/shardingsphere/broadcast/yaml/config/YamlBroadcastRuleConfiguration.java
 
b/features/broadcast/core/src/main/java/org/apache/shardingsphere/broadcast/yaml/config/YamlBroadcastRuleConfiguration.java
index 4cb41c916a6..a76e04a3ce1 100644
--- 
a/features/broadcast/core/src/main/java/org/apache/shardingsphere/broadcast/yaml/config/YamlBroadcastRuleConfiguration.java
+++ 
b/features/broadcast/core/src/main/java/org/apache/shardingsphere/broadcast/yaml/config/YamlBroadcastRuleConfiguration.java
@@ -20,11 +20,10 @@ package org.apache.shardingsphere.broadcast.yaml.config;
 import lombok.Getter;
 import lombok.Setter;
 import 
org.apache.shardingsphere.broadcast.api.config.BroadcastRuleConfiguration;
-import 
org.apache.shardingsphere.broadcast.metadata.nodepath.BroadcastRuleNodePathProvider;
 import org.apache.shardingsphere.infra.config.rule.RuleConfiguration;
 import 
org.apache.shardingsphere.infra.yaml.config.pojo.rule.YamlRuleConfiguration;
-import 
org.apache.shardingsphere.infra.yaml.config.pojo.rule.annotation.RepositoryTupleField;
 import 
org.apache.shardingsphere.infra.yaml.config.pojo.rule.annotation.RepositoryTupleEntity;
+import 
org.apache.shardingsphere.infra.yaml.config.pojo.rule.annotation.RepositoryTupleField;
 import 
org.apache.shardingsphere.infra.yaml.config.pojo.rule.annotation.RepositoryTupleField.Type;
 
 import java.util.Collection;
@@ -38,7 +37,7 @@ import java.util.LinkedList;
 @Setter
 public final class YamlBroadcastRuleConfiguration implements 
YamlRuleConfiguration {
     
-    @RepositoryTupleField(value = BroadcastRuleNodePathProvider.TABLES, type = 
Type.TABLE)
+    @RepositoryTupleField(type = Type.TABLE)
     private Collection<String> tables = new LinkedList<>();
     
     @Override
diff --git 
a/features/encrypt/core/src/main/java/org/apache/shardingsphere/encrypt/yaml/config/YamlEncryptRuleConfiguration.java
 
b/features/encrypt/core/src/main/java/org/apache/shardingsphere/encrypt/yaml/config/YamlEncryptRuleConfiguration.java
index 583db75cff6..8fb233e5acd 100644
--- 
a/features/encrypt/core/src/main/java/org/apache/shardingsphere/encrypt/yaml/config/YamlEncryptRuleConfiguration.java
+++ 
b/features/encrypt/core/src/main/java/org/apache/shardingsphere/encrypt/yaml/config/YamlEncryptRuleConfiguration.java
@@ -20,12 +20,11 @@ package org.apache.shardingsphere.encrypt.yaml.config;
 import lombok.Getter;
 import lombok.Setter;
 import org.apache.shardingsphere.encrypt.api.config.EncryptRuleConfiguration;
-import 
org.apache.shardingsphere.encrypt.metadata.nodepath.EncryptRuleNodePathProvider;
 import 
org.apache.shardingsphere.encrypt.yaml.config.rule.YamlEncryptTableRuleConfiguration;
 import 
org.apache.shardingsphere.infra.algorithm.core.yaml.YamlAlgorithmConfiguration;
 import 
org.apache.shardingsphere.infra.yaml.config.pojo.rule.YamlRuleConfiguration;
-import 
org.apache.shardingsphere.infra.yaml.config.pojo.rule.annotation.RepositoryTupleField;
 import 
org.apache.shardingsphere.infra.yaml.config.pojo.rule.annotation.RepositoryTupleEntity;
+import 
org.apache.shardingsphere.infra.yaml.config.pojo.rule.annotation.RepositoryTupleField;
 import 
org.apache.shardingsphere.infra.yaml.config.pojo.rule.annotation.RepositoryTupleField.Type;
 
 import java.util.LinkedHashMap;
@@ -39,10 +38,10 @@ import java.util.Map;
 @Setter
 public final class YamlEncryptRuleConfiguration implements 
YamlRuleConfiguration {
     
-    @RepositoryTupleField(value = EncryptRuleNodePathProvider.TABLES, type = 
Type.TABLE)
+    @RepositoryTupleField(type = Type.TABLE)
     private Map<String, YamlEncryptTableRuleConfiguration> tables = new 
LinkedHashMap<>();
     
-    @RepositoryTupleField(value = EncryptRuleNodePathProvider.ENCRYPTORS, type 
= Type.ALGORITHM)
+    @RepositoryTupleField(type = Type.ALGORITHM)
     private Map<String, YamlAlgorithmConfiguration> encryptors = new 
LinkedHashMap<>();
     
     @Override
diff --git 
a/features/mask/core/src/main/java/org/apache/shardingsphere/mask/yaml/config/YamlMaskRuleConfiguration.java
 
b/features/mask/core/src/main/java/org/apache/shardingsphere/mask/yaml/config/YamlMaskRuleConfiguration.java
index 754bc42b28a..045b89cff73 100644
--- 
a/features/mask/core/src/main/java/org/apache/shardingsphere/mask/yaml/config/YamlMaskRuleConfiguration.java
+++ 
b/features/mask/core/src/main/java/org/apache/shardingsphere/mask/yaml/config/YamlMaskRuleConfiguration.java
@@ -25,7 +25,6 @@ import 
org.apache.shardingsphere.infra.yaml.config.pojo.rule.annotation.Reposito
 import 
org.apache.shardingsphere.infra.yaml.config.pojo.rule.annotation.RepositoryTupleField;
 import 
org.apache.shardingsphere.infra.yaml.config.pojo.rule.annotation.RepositoryTupleField.Type;
 import org.apache.shardingsphere.mask.api.config.MaskRuleConfiguration;
-import 
org.apache.shardingsphere.mask.metadata.nodepath.MaskRuleNodePathProvider;
 import 
org.apache.shardingsphere.mask.yaml.config.rule.YamlMaskTableRuleConfiguration;
 
 import java.util.LinkedHashMap;
@@ -39,10 +38,10 @@ import java.util.Map;
 @Setter
 public final class YamlMaskRuleConfiguration implements YamlRuleConfiguration {
     
-    @RepositoryTupleField(value = MaskRuleNodePathProvider.TABLES, type = 
Type.TABLE)
+    @RepositoryTupleField(type = Type.TABLE)
     private Map<String, YamlMaskTableRuleConfiguration> tables = new 
LinkedHashMap<>();
     
-    @RepositoryTupleField(value = MaskRuleNodePathProvider.MASK_ALGORITHMS, 
type = Type.ALGORITHM)
+    @RepositoryTupleField(type = Type.ALGORITHM)
     private Map<String, YamlAlgorithmConfiguration> maskAlgorithms = new 
LinkedHashMap<>();
     
     @Override
diff --git 
a/features/readwrite-splitting/core/src/main/java/org/apache/shardingsphere/readwritesplitting/yaml/config/YamlReadwriteSplittingRuleConfiguration.java
 
b/features/readwrite-splitting/core/src/main/java/org/apache/shardingsphere/readwritesplitting/yaml/config/YamlReadwriteSplittingRuleConfiguration.java
index 5da718c2124..16de8cbad1a 100644
--- 
a/features/readwrite-splitting/core/src/main/java/org/apache/shardingsphere/readwritesplitting/yaml/config/YamlReadwriteSplittingRuleConfiguration.java
+++ 
b/features/readwrite-splitting/core/src/main/java/org/apache/shardingsphere/readwritesplitting/yaml/config/YamlReadwriteSplittingRuleConfiguration.java
@@ -42,7 +42,7 @@ public final class YamlReadwriteSplittingRuleConfiguration 
implements YamlRuleCo
     @RepositoryTupleField(value = 
ReadwriteSplittingRuleNodePathProvider.DATA_SOURCES, type = Type.DATA_SOURCE)
     private Map<String, 
YamlReadwriteSplittingDataSourceGroupRuleConfiguration> dataSourceGroups = new 
LinkedHashMap<>();
     
-    @RepositoryTupleField(value = 
ReadwriteSplittingRuleNodePathProvider.LOAD_BALANCERS, type = Type.ALGORITHM)
+    @RepositoryTupleField(type = Type.ALGORITHM)
     private Map<String, YamlAlgorithmConfiguration> loadBalancers = new 
LinkedHashMap<>();
     
     @Override
diff --git 
a/features/shadow/core/src/main/java/org/apache/shardingsphere/shadow/yaml/config/YamlShadowRuleConfiguration.java
 
b/features/shadow/core/src/main/java/org/apache/shardingsphere/shadow/yaml/config/YamlShadowRuleConfiguration.java
index 7d55a358033..414c3362272 100644
--- 
a/features/shadow/core/src/main/java/org/apache/shardingsphere/shadow/yaml/config/YamlShadowRuleConfiguration.java
+++ 
b/features/shadow/core/src/main/java/org/apache/shardingsphere/shadow/yaml/config/YamlShadowRuleConfiguration.java
@@ -40,10 +40,10 @@ import java.util.Map;
 @Setter
 public final class YamlShadowRuleConfiguration implements 
YamlRuleConfiguration {
     
-    @RepositoryTupleField(value = ShadowRuleNodePathProvider.DATA_SOURCES, 
type = Type.DATA_SOURCE)
+    @RepositoryTupleField(type = Type.DATA_SOURCE)
     private Map<String, YamlShadowDataSourceConfiguration> dataSources = new 
LinkedHashMap<>();
     
-    @RepositoryTupleField(value = ShadowRuleNodePathProvider.TABLES, type = 
Type.TABLE)
+    @RepositoryTupleField(type = Type.TABLE)
     private Map<String, YamlShadowTableConfiguration> tables = new 
LinkedHashMap<>();
     
     @RepositoryTupleField(value = ShadowRuleNodePathProvider.ALGORITHMS, type 
= Type.ALGORITHM)
diff --git 
a/features/sharding/core/src/main/java/org/apache/shardingsphere/sharding/yaml/config/YamlShardingRuleConfiguration.java
 
b/features/sharding/core/src/main/java/org/apache/shardingsphere/sharding/yaml/config/YamlShardingRuleConfiguration.java
index bc3f6cb4ce8..c2ab51163bd 100644
--- 
a/features/sharding/core/src/main/java/org/apache/shardingsphere/sharding/yaml/config/YamlShardingRuleConfiguration.java
+++ 
b/features/sharding/core/src/main/java/org/apache/shardingsphere/sharding/yaml/config/YamlShardingRuleConfiguration.java
@@ -48,41 +48,41 @@ import java.util.Map;
 @Setter
 public final class YamlShardingRuleConfiguration implements 
YamlRuleConfiguration {
     
-    @RepositoryTupleField(value = ShardingRuleNodePathProvider.TABLES, type = 
Type.TABLE)
+    @RepositoryTupleField(type = Type.TABLE)
     private Map<String, YamlTableRuleConfiguration> tables = new 
LinkedHashMap<>();
     
-    @RepositoryTupleField(value = ShardingRuleNodePathProvider.AUTO_TABLES, 
type = Type.TABLE)
+    @RepositoryTupleField(type = Type.TABLE)
     private Map<String, YamlShardingAutoTableRuleConfiguration> autoTables = 
new LinkedHashMap<>();
     
-    @RepositoryTupleField(value = ShardingRuleNodePathProvider.BINDING_TABLES, 
type = Type.TABLE)
+    @RepositoryTupleField(type = Type.TABLE)
     
@RepositoryTupleKeyListNameGenerator(ShardingBindingTableRepositoryTupleKeyListNameGenerator.class)
     private Collection<String> bindingTables = new LinkedList<>();
     
-    @RepositoryTupleField(value = 
ShardingRuleNodePathProvider.DEFAULT_DATABASE_STRATEGY, type = 
Type.DEFAULT_STRATEGY)
+    @RepositoryTupleField(type = Type.DEFAULT_STRATEGY)
     private YamlShardingStrategyConfiguration defaultDatabaseStrategy;
     
-    @RepositoryTupleField(value = 
ShardingRuleNodePathProvider.DEFAULT_TABLE_STRATEGY, type = 
Type.DEFAULT_STRATEGY)
+    @RepositoryTupleField(type = Type.DEFAULT_STRATEGY)
     private YamlShardingStrategyConfiguration defaultTableStrategy;
     
-    @RepositoryTupleField(value = 
ShardingRuleNodePathProvider.DEFAULT_KEY_GENERATE_STRATEGY, type = 
Type.DEFAULT_STRATEGY)
+    @RepositoryTupleField(type = Type.DEFAULT_STRATEGY)
     private YamlKeyGenerateStrategyConfiguration defaultKeyGenerateStrategy;
     
-    @RepositoryTupleField(value = 
ShardingRuleNodePathProvider.DEFAULT_AUDIT_STRATEGY, type = 
Type.DEFAULT_STRATEGY)
+    @RepositoryTupleField(type = Type.DEFAULT_STRATEGY)
     private YamlShardingAuditStrategyConfiguration defaultAuditStrategy;
     
     @RepositoryTupleField(value = ShardingRuleNodePathProvider.ALGORITHMS, 
type = Type.ALGORITHM)
     private Map<String, YamlAlgorithmConfiguration> shardingAlgorithms = new 
LinkedHashMap<>();
     
-    @RepositoryTupleField(value = ShardingRuleNodePathProvider.KEY_GENERATORS, 
type = Type.ALGORITHM)
+    @RepositoryTupleField(type = Type.ALGORITHM)
     private Map<String, YamlAlgorithmConfiguration> keyGenerators = new 
LinkedHashMap<>();
     
-    @RepositoryTupleField(value = ShardingRuleNodePathProvider.AUDITORS, type 
= Type.ALGORITHM)
+    @RepositoryTupleField(type = Type.ALGORITHM)
     private Map<String, YamlAlgorithmConfiguration> auditors = new 
LinkedHashMap<>();
     
-    @RepositoryTupleField(value = 
ShardingRuleNodePathProvider.DEFAULT_SHARDING_COLUMN, type = Type.OTHER)
+    @RepositoryTupleField(type = Type.OTHER)
     private String defaultShardingColumn;
     
-    @RepositoryTupleField(value = ShardingRuleNodePathProvider.SHARDING_CACHE, 
type = Type.OTHER)
+    @RepositoryTupleField(type = Type.OTHER)
     private YamlShardingCacheConfiguration shardingCache;
     
     @Override
diff --git 
a/infra/common/src/main/java/org/apache/shardingsphere/infra/yaml/config/pojo/rule/annotation/RepositoryTupleField.java
 
b/infra/common/src/main/java/org/apache/shardingsphere/infra/yaml/config/pojo/rule/annotation/RepositoryTupleField.java
index 31bcf22ef25..140b253c9b3 100644
--- 
a/infra/common/src/main/java/org/apache/shardingsphere/infra/yaml/config/pojo/rule/annotation/RepositoryTupleField.java
+++ 
b/infra/common/src/main/java/org/apache/shardingsphere/infra/yaml/config/pojo/rule/annotation/RepositoryTupleField.java
@@ -36,7 +36,7 @@ public @interface RepositoryTupleField {
      * 
      * @return persist path name
      */
-    String value();
+    String value() default "";
     
     /**
      * Get type.
diff --git 
a/mode/api/src/main/java/org/apache/shardingsphere/mode/engine/RepositoryTupleSwapperEngine.java
 
b/mode/api/src/main/java/org/apache/shardingsphere/mode/engine/RepositoryTupleSwapperEngine.java
index 13e0ea551f8..d156658b960 100644
--- 
a/mode/api/src/main/java/org/apache/shardingsphere/mode/engine/RepositoryTupleSwapperEngine.java
+++ 
b/mode/api/src/main/java/org/apache/shardingsphere/mode/engine/RepositoryTupleSwapperEngine.java
@@ -17,6 +17,7 @@
 
 package org.apache.shardingsphere.mode.engine;
 
+import com.google.common.base.CaseFormat;
 import com.google.common.base.Strings;
 import lombok.SneakyThrows;
 import org.apache.shardingsphere.infra.config.rule.RuleConfiguration;
@@ -89,36 +90,36 @@ public final class RepositoryTupleSwapperEngine {
         if (null == fieldValue) {
             return Collections.emptyList();
         }
-        RepositoryTupleField tupleField = 
field.getAnnotation(RepositoryTupleField.class);
+        String tupleName = getTupleName(field);
         RepositoryTupleKeyListNameGenerator tupleKeyListNameGenerator = 
field.getAnnotation(RepositoryTupleKeyListNameGenerator.class);
         if (null != tupleKeyListNameGenerator && fieldValue instanceof 
Collection) {
             Collection<RepositoryTuple> result = new LinkedList<>();
             for (Object value : (Collection) fieldValue) {
                 String tupleKeyName = 
tupleKeyListNameGenerator.value().getConstructor().newInstance().generate(value);
-                result.add(new 
RepositoryTuple(ruleNodePath.getNamedItem(tupleField.value()).getPath(tupleKeyName),
 value.toString()));
+                result.add(new 
RepositoryTuple(ruleNodePath.getNamedItem(tupleName).getPath(tupleKeyName), 
value.toString()));
             }
             return result;
         }
         if (fieldValue instanceof Map) {
             Collection<RepositoryTuple> result = new LinkedList<>();
             for (Object entry : ((Map) fieldValue).entrySet()) {
-                result.add(new 
RepositoryTuple(ruleNodePath.getNamedItem(tupleField.value()).getPath(((Entry) 
entry).getKey().toString()), YamlEngine.marshal(((Entry) entry).getValue())));
+                result.add(new 
RepositoryTuple(ruleNodePath.getNamedItem(tupleName).getPath(((Entry) 
entry).getKey().toString()), YamlEngine.marshal(((Entry) entry).getValue())));
             }
             return result;
         }
         if (fieldValue instanceof Collection && !((Collection) 
fieldValue).isEmpty()) {
-            return Collections.singleton(new 
RepositoryTuple(ruleNodePath.getUniqueItem(tupleField.value()).getPath(), 
YamlEngine.marshal(fieldValue)));
+            return Collections.singleton(new 
RepositoryTuple(ruleNodePath.getUniqueItem(tupleName).getPath(), 
YamlEngine.marshal(fieldValue)));
         }
         if (fieldValue instanceof String && !((String) fieldValue).isEmpty()) {
-            return Collections.singleton(new 
RepositoryTuple(ruleNodePath.getUniqueItem(tupleField.value()).getPath(), 
fieldValue.toString()));
+            return Collections.singleton(new 
RepositoryTuple(ruleNodePath.getUniqueItem(tupleName).getPath(), 
fieldValue.toString()));
         }
         if (fieldValue instanceof Boolean || fieldValue instanceof Integer || 
fieldValue instanceof Long) {
-            return Collections.singleton(new 
RepositoryTuple(ruleNodePath.getUniqueItem(tupleField.value()).getPath(), 
fieldValue.toString()));
+            return Collections.singleton(new 
RepositoryTuple(ruleNodePath.getUniqueItem(tupleName).getPath(), 
fieldValue.toString()));
         }
         if (fieldValue instanceof Enum) {
-            return Collections.singleton(new 
RepositoryTuple(ruleNodePath.getUniqueItem(tupleField.value()).getPath(), 
((Enum) fieldValue).name()));
+            return Collections.singleton(new 
RepositoryTuple(ruleNodePath.getUniqueItem(tupleName).getPath(), ((Enum) 
fieldValue).name()));
         }
-        return Collections.singleton(new 
RepositoryTuple(ruleNodePath.getUniqueItem(tupleField.value()).getPath(), 
YamlEngine.marshal(fieldValue)));
+        return Collections.singleton(new 
RepositoryTuple(ruleNodePath.getUniqueItem(tupleName).getPath(), 
YamlEngine.marshal(fieldValue)));
     }
     
     private Collection<Field> getFields(final Class<? extends 
YamlRuleConfiguration> yamlRuleConfigurationClass) {
@@ -127,6 +128,11 @@ public final class RepositoryTupleSwapperEngine {
                 .sorted(Comparator.comparingInt(o -> 
o.getAnnotation(RepositoryTupleField.class).type().ordinal())).collect(Collectors.toList());
     }
     
+    private String getTupleName(final Field field) {
+        RepositoryTupleField tupleField = 
field.getAnnotation(RepositoryTupleField.class);
+        return "".equals(tupleField.value()) ? 
CaseFormat.LOWER_CAMEL.to(CaseFormat.LOWER_UNDERSCORE, field.getName()) : 
tupleField.value();
+    }
+    
     /**
      * Swap from repository tuple to YAML rule configurations.
      *
@@ -196,49 +202,49 @@ public final class RepositoryTupleSwapperEngine {
     @SuppressWarnings({"unchecked", "rawtypes"})
     private void setFieldValue(final YamlRuleConfiguration yamlRuleConfig, 
final Field field, final RuleNodePath ruleNodePath, final RepositoryTuple 
repositoryTuple) throws IllegalAccessException {
         Object fieldValue = field.get(yamlRuleConfig);
-        RepositoryTupleField tupleField = 
field.getAnnotation(RepositoryTupleField.class);
+        String tupleName = getTupleName(field);
         RepositoryTupleKeyListNameGenerator tupleKeyListNameGenerator = 
field.getAnnotation(RepositoryTupleKeyListNameGenerator.class);
         if (null != tupleKeyListNameGenerator && fieldValue instanceof 
Collection) {
-            
ruleNodePath.getNamedItem(tupleField.value()).getName(repositoryTuple.getKey()).ifPresent(optional
 -> ((Collection) fieldValue).add(repositoryTuple.getValue()));
+            
ruleNodePath.getNamedItem(tupleName).getName(repositoryTuple.getKey()).ifPresent(optional
 -> ((Collection) fieldValue).add(repositoryTuple.getValue()));
             return;
         }
         if (fieldValue instanceof Map) {
             Class<?> valueClass = (Class) ((ParameterizedType) 
field.getGenericType()).getActualTypeArguments()[1];
-            
ruleNodePath.getNamedItem(tupleField.value()).getName(repositoryTuple.getKey())
+            
ruleNodePath.getNamedItem(tupleName).getName(repositoryTuple.getKey())
                     .ifPresent(optional -> ((Map) fieldValue).put(optional, 
YamlEngine.unmarshal(repositoryTuple.getValue(), valueClass)));
             return;
         }
         if (fieldValue instanceof Collection) {
-            if 
(ruleNodePath.getUniqueItem(tupleField.value()).isValidatedPath(repositoryTuple.getKey()))
 {
+            if 
(ruleNodePath.getUniqueItem(tupleName).isValidatedPath(repositoryTuple.getKey()))
 {
                 field.set(yamlRuleConfig, 
YamlEngine.unmarshal(repositoryTuple.getValue(), List.class));
             }
             return;
         }
         if (field.getType().equals(String.class)) {
-            if 
(ruleNodePath.getUniqueItem(tupleField.value()).isValidatedPath(repositoryTuple.getKey()))
 {
+            if 
(ruleNodePath.getUniqueItem(tupleName).isValidatedPath(repositoryTuple.getKey()))
 {
                 field.set(yamlRuleConfig, repositoryTuple.getValue());
             }
             return;
         }
         if (field.getType().equals(boolean.class) || 
field.getType().equals(Boolean.class)) {
-            if 
(ruleNodePath.getUniqueItem(tupleField.value()).isValidatedPath(repositoryTuple.getKey()))
 {
+            if 
(ruleNodePath.getUniqueItem(tupleName).isValidatedPath(repositoryTuple.getKey()))
 {
                 field.set(yamlRuleConfig, 
Boolean.parseBoolean(repositoryTuple.getValue()));
             }
             return;
         }
         if (field.getType().equals(int.class) || 
field.getType().equals(Integer.class)) {
-            if 
(ruleNodePath.getUniqueItem(tupleField.value()).isValidatedPath(repositoryTuple.getKey()))
 {
+            if 
(ruleNodePath.getUniqueItem(tupleName).isValidatedPath(repositoryTuple.getKey()))
 {
                 field.set(yamlRuleConfig, 
Integer.parseInt(repositoryTuple.getValue()));
             }
             return;
         }
         if (field.getType().equals(long.class) || 
field.getType().equals(Long.class)) {
-            if 
(ruleNodePath.getUniqueItem(tupleField.value()).isValidatedPath(repositoryTuple.getKey()))
 {
+            if 
(ruleNodePath.getUniqueItem(tupleName).isValidatedPath(repositoryTuple.getKey()))
 {
                 field.set(yamlRuleConfig, 
Long.parseLong(repositoryTuple.getValue()));
             }
             return;
         }
-        if 
(ruleNodePath.getUniqueItem(tupleField.value()).isValidatedPath(repositoryTuple.getKey()))
 {
+        if 
(ruleNodePath.getUniqueItem(tupleName).isValidatedPath(repositoryTuple.getKey()))
 {
             field.set(yamlRuleConfig, 
YamlEngine.unmarshal(repositoryTuple.getValue(), field.getType()));
         }
     }

Reply via email to