/** * Resolves and applies the specified properties to this protocol. * @param properties a map of property string values * @return this protocol * @throws Exception if any of the specified properties are unresolvable or unrecognized. */ public <T extends Protocol> T setProperties(Map<String, String> properties) throws Exception { // These Configurator methods are destructive, so make a defensive copy Map<String, String> copy = new HashMap<>(properties); Configurator.removeDeprecatedProperties(this, copy); Configurator.resolveAndAssignFields(this, copy); Configurator.resolveAndInvokePropertyMethods(this, copy); List<Object> objects = this.getConfigurableObjects(); if (objects != null) { for (Object object : objects) { Configurator.removeDeprecatedProperties(object, copy); Configurator.resolveAndAssignFields(object, copy); Configurator.resolveAndInvokePropertyMethods(object, copy); } } if (!copy.isEmpty()) { throw new IllegalArgumentException(String.format("Unrecognized %s properties: %s", this.getName(), copy.keySet())); } return (T)this; }
retval.setProtocolStack(stack); removeDeprecatedProperties(retval, properties);
/** * Resolves and applies the specified properties to this protocol. * @param properties a map of property string values * @return this protocol * @throws Exception if any of the specified properties are unresolvable or unrecognized. */ public <T extends Protocol> T setProperties(Map<String, String> properties) throws Exception { // These Configurator methods are destructive, so make a defensive copy Map<String, String> copy = new HashMap<>(properties); Configurator.removeDeprecatedProperties(this, copy); Configurator.resolveAndAssignFields(this, copy); Configurator.resolveAndInvokePropertyMethods(this, copy); List<Object> objects = this.getConfigurableObjects(); if (objects != null) { for (Object object : objects) { Configurator.removeDeprecatedProperties(object, copy); Configurator.resolveAndAssignFields(object, copy); Configurator.resolveAndInvokePropertyMethods(object, copy); } } if (!copy.isEmpty()) { throw new IllegalArgumentException(String.format("Unrecognized %s properties: %s", this.getName(), copy.keySet())); } return (T)this; }
retval.setProtocolStack(stack); removeDeprecatedProperties(retval, properties);