public ConfigElement combine(ConfigElement element) { RemoteConfigElement configElement = (RemoteConfigElement) element; // new combined element RemoteConfigElement combinedElement = new RemoteConfigElement(); // copy in our things combinedElement.connectors.putAll(this.connectors); combinedElement.authenticators.putAll(this.authenticators); combinedElement.endpoints.putAll(this.endpoints); // override with things from the merging object combinedElement.connectors.putAll(configElement.connectors); combinedElement.authenticators.putAll(configElement.authenticators); combinedElement.endpoints.putAll(configElement.endpoints); // default endpoint id combinedElement.defaultEndpointId = this.defaultEndpointId; if(configElement.defaultEndpointId != null) { combinedElement.defaultEndpointId = configElement.defaultEndpointId; } // default credential vault provider id combinedElement.defaultCredentialVaultProviderId = this.defaultCredentialVaultProviderId; if(configElement.defaultCredentialVaultProviderId != null) { combinedElement.defaultCredentialVaultProviderId = configElement.defaultCredentialVaultProviderId; } // return the combined element return combinedElement; }
RemoteConfigElement combinedElement = new RemoteConfigElement();
RemoteConfigElement combinedElement = new RemoteConfigElement();
RemoteConfigElement configElement = new RemoteConfigElement();
RemoteConfigElement configElement = new RemoteConfigElement();
RemoteConfigElement configElement = new RemoteConfigElement();