Skip to content

Commit

Permalink
Polish apache#3946 : Refactor Dubbo metadata service
Browse files Browse the repository at this point in the history
  • Loading branch information
mercyblitz committed May 21, 2019
1 parent ab6a818 commit beb570d
Showing 1 changed file with 16 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@
import org.apache.dubbo.common.URL;

import java.util.List;
import java.util.stream.Collectors;

import static java.util.stream.StreamSupport.stream;

/**
* A framework interface of Dubbo Metadata Service defines the contract of Dubbo Services registartion and subscription
Expand Down Expand Up @@ -132,4 +135,17 @@ default List<String> getExportedURLs(String serviceInterface, String group, Stri
* @see URL
*/
List<String> getExportedURLs(String serviceInterface, String group, String version, String protocol);


/**
* Convert the multiple {@link URL urls} to a {@link List list} of {@link URL urls}
*
* @param urls the strings presents the {@link URL Dubbo URLs}
* @return non-null
*/
static List<URL> toURLs(Iterable<String> urls) {
return stream(urls.spliterator(), false)
.map(URL::valueOf)
.collect(Collectors.toList());
}
}

0 comments on commit beb570d

Please sign in to comment.