This is an automated email from the ASF dual-hosted git repository. wuweijie 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 118f6dcaf81 Remove useless RuleExportEngine (#30428) 118f6dcaf81 is described below commit 118f6dcaf81ce94d9d48953f07b1ccef5e43dd8e Author: Liang Zhang <zhangli...@apache.org> AuthorDate: Fri Mar 8 07:39:03 2024 +0800 Remove useless RuleExportEngine (#30428) --- .../type/exportable/RuleExportEngine.java | 61 ---------------------- 1 file changed, 61 deletions(-) diff --git a/infra/common/src/main/java/org/apache/shardingsphere/infra/rule/identifier/type/exportable/RuleExportEngine.java b/infra/common/src/main/java/org/apache/shardingsphere/infra/rule/identifier/type/exportable/RuleExportEngine.java deleted file mode 100644 index 1bfb6c8c65d..00000000000 --- a/infra/common/src/main/java/org/apache/shardingsphere/infra/rule/identifier/type/exportable/RuleExportEngine.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * 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.shardingsphere.infra.rule.identifier.type.exportable; - -import lombok.RequiredArgsConstructor; - -import java.util.Collection; -import java.util.HashMap; -import java.util.Map; -import java.util.Optional; - -/** - * Rule export engine. - */ -@RequiredArgsConstructor -public final class RuleExportEngine { - - private final ExportableRule rule; - - /** - * Export data by specified key. - * - * @param keys specified keys - * @return data map - */ - public Map<String, Object> export(final Collection<String> keys) { - Map<String, Object> exportMethods = rule.getExportData(); - Map<String, Object> result = new HashMap<>(keys.size(), 1F); - keys.forEach(each -> { - if (exportMethods.containsKey(each)) { - result.put(each, exportMethods.get(each)); - } - }); - return result; - } - - /** - * Export data by specified key. - * - * @param key specified key - * @return data - */ - public Optional<Object> export(final String key) { - return Optional.ofNullable(rule.getExportData().get(key)); - } -}