You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2020/08/25 08:10:35 UTC

[camel] branch master updated: Argh regen added to much in last commit

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

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


The following commit(s) were added to refs/heads/master by this push:
     new 8280bb4  Argh regen added to much in last commit
8280bb4 is described below

commit 8280bb4a3b9ccde37d3d9d722981eb58a6dde06c
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Tue Aug 25 10:09:34 2020 +0200

    Argh regen added to much in last commit
---
 .../camel/support/PropertyBindingSupport.java      | 53 +---------------------
 1 file changed, 1 insertion(+), 52 deletions(-)

diff --git a/core/camel-support/src/main/java/org/apache/camel/support/PropertyBindingSupport.java b/core/camel-support/src/main/java/org/apache/camel/support/PropertyBindingSupport.java
index d0840f4..246d339 100644
--- a/core/camel-support/src/main/java/org/apache/camel/support/PropertyBindingSupport.java
+++ b/core/camel-support/src/main/java/org/apache/camel/support/PropertyBindingSupport.java
@@ -96,7 +96,6 @@ public final class PropertyBindingSupport {
         private CamelContext camelContext;
         private Object target;
         private Map<String, Object> properties;
-        private Map<String, Map<String, Object>> map;
         private boolean removeParameters = true;
         private boolean mandatory;
         private boolean nesting = true;
@@ -142,21 +141,6 @@ public final class PropertyBindingSupport {
         }
 
         /**
-         * The map of map that holds the properties to use.
-         */
-        public Builder map(Map<String, Map<String, Object>> map) {
-            if (this.map == null) {
-                this.map = map;
-            } else {
-                // there may be existing options so add those if missing
-                // we need to mutate existing as we are may be removing bound properties
-                this.map.forEach(map::putIfAbsent);
-                this.map = map;
-            }
-            return this;
-        }
-
-        /**
          * Adds property to use for binding
          */
         public Builder withProperty(String key, Object value) {
@@ -276,12 +260,9 @@ public final class PropertyBindingSupport {
             org.apache.camel.util.ObjectHelper.notNull(camelContext, "camelContext");
             org.apache.camel.util.ObjectHelper.notNull(target, "target");
 
-            if ((properties == null || properties.isEmpty()) && (map == null || map.isEmpty())) {
+            if (properties == null || properties.isEmpty()) {
                 return false;
             }
-            if (properties != null && map != null) {
-                throw new IllegalArgumentException("Only either properties or map can be used, not both at the same time");
-            }
 
             return doBindProperties(camelContext, target, removeParameters ? properties : new HashMap<>(properties),
                     optionPrefix, ignoreCase, true, mandatory,
@@ -301,44 +282,12 @@ public final class PropertyBindingSupport {
             Object obj = target != null ? target : this.target;
             Map<String, Object> prop = properties != null ? properties : this.properties;
 
-            // flattern map as facade for doBindProperties
-            Map<String, Object> facade = flatternMapToProperties(map);
-
             return doBindProperties(context, obj, removeParameters ? prop : new HashMap<>(prop),
                     optionPrefix, ignoreCase, true, mandatory,
                     nesting, deepNesting, fluentBuilder, allowPrivateSetter, reference, placeholder, reflection, configurer);
         }
 
         /**
-         * Binds the properties to the target object, and removes the property that was bound from properties.
-         *
-         * @param  camelContext the camel context
-         * @param  target       the target object
-         * @param  map          the map of map that holds the properties to use
-         * @return              true if one or more properties was bound
-         */
-        public boolean bind(CamelContext camelContext, Object target, Map<String, Map<String, Object>> map) {
-            CamelContext context = camelContext != null ? camelContext : this.camelContext;
-            Object obj = target != null ? target : this.target;
-            Map<String, Map<String, Object>> prop = map != null ? map : this.map;
-            if (!removeParameters) {
-                prop = new HashMap<>(prop);
-            }
-
-            // flattern map as facade for doBindProperties
-            Map<String, Object> facade = flatternMapToProperties(map);
-
-            return doBindProperties(context, obj, facade,
-                    optionPrefix, ignoreCase, true, mandatory,
-                    nesting, deepNesting, fluentBuilder, allowPrivateSetter, reference, placeholder, reflection, configurer);
-        }
-
-        private static Map<String, Object> flatternMapToProperties(Map<String, Map<String, Object>> map) {
-            // TODO:
-
-        }
-
-        /**
          * Binds the property to the target object.
          *
          * @param  camelContext the camel context