diff --git a/common/src/main/java/com/alibaba/nacos/common/http/AbstractHttpClientFactory.java b/common/src/main/java/com/alibaba/nacos/common/http/AbstractHttpClientFactory.java index feaf57e24..bea142b74 100644 --- a/common/src/main/java/com/alibaba/nacos/common/http/AbstractHttpClientFactory.java +++ b/common/src/main/java/com/alibaba/nacos/common/http/AbstractHttpClientFactory.java @@ -24,7 +24,7 @@ import com.alibaba.nacos.common.tls.SelfHostnameVerifier; import com.alibaba.nacos.common.tls.TlsFileWatcher; import com.alibaba.nacos.common.tls.TlsHelper; import com.alibaba.nacos.common.tls.TlsSystemConfig; -import com.alibaba.nacos.common.utils.BiConsumer; +import java.util.function.BiConsumer; import org.apache.http.client.config.RequestConfig; import org.apache.http.config.Registry; import org.apache.http.config.RegistryBuilder; diff --git a/common/src/main/java/com/alibaba/nacos/common/notify/EventPublisherFactory.java b/common/src/main/java/com/alibaba/nacos/common/notify/EventPublisherFactory.java index ccf291a77..75f7c970a 100644 --- a/common/src/main/java/com/alibaba/nacos/common/notify/EventPublisherFactory.java +++ b/common/src/main/java/com/alibaba/nacos/common/notify/EventPublisherFactory.java @@ -16,7 +16,7 @@ package com.alibaba.nacos.common.notify; -import com.alibaba.nacos.common.utils.BiFunction; +import java.util.function.BiFunction; /** * Event publisher factory. diff --git a/common/src/main/java/com/alibaba/nacos/common/utils/BiConsumer.java b/common/src/main/java/com/alibaba/nacos/common/utils/BiConsumer.java deleted file mode 100644 index dfbc32025..000000000 --- a/common/src/main/java/com/alibaba/nacos/common/utils/BiConsumer.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright 1999-2018 Alibaba Group Holding Ltd. - * - * Licensed 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 com.alibaba.nacos.common.utils; - -/** - * Represents an operation that accepts two input arguments and returns no result. - * - * @author wangwei - */ -public interface BiConsumer { - - /** - * Performs this operation on the given arguments. - * - * @param t the first input argument - * @param u the second input argument - */ - void accept(T t, U u); -} \ No newline at end of file diff --git a/common/src/main/java/com/alibaba/nacos/common/utils/BiFunction.java b/common/src/main/java/com/alibaba/nacos/common/utils/BiFunction.java deleted file mode 100644 index b436e4950..000000000 --- a/common/src/main/java/com/alibaba/nacos/common/utils/BiFunction.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright 1999-2018 Alibaba Group Holding Ltd. - * - * Licensed 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 com.alibaba.nacos.common.utils; - -/** - * Represents a function that accepts two arguments and produces a result. The following utility functions are extracted - * from org.apache.commons.lang3. - * - *

This is a functional interface - * whose functional method is {@link #apply(Object, Object)}. - * - * @author zongtanghu - */ -public interface BiFunction { - - /** - * Applies this function to the two given arguments. - * - * @param t the first function argument - * @param u the second function argument - * @return the function result - */ - R apply(T t, U u); -} diff --git a/common/src/main/java/com/alibaba/nacos/common/utils/MapUtil.java b/common/src/main/java/com/alibaba/nacos/common/utils/MapUtil.java index f466b35fb..2145e9fbb 100644 --- a/common/src/main/java/com/alibaba/nacos/common/utils/MapUtil.java +++ b/common/src/main/java/com/alibaba/nacos/common/utils/MapUtil.java @@ -23,6 +23,7 @@ import java.util.Dictionary; import java.util.Map; import java.util.Objects; import java.util.function.Predicate; +import java.util.function.BiFunction; /** * Map utils.