public static ServerListConfig namespaceUris(ServerListConfig config, String namespace) { Set<String> serversWithNamespaces = config .servers() .stream() .map(serverAddress -> serverAddress.replaceAll("/$", "") + "/" + namespace) .collect(Collectors.toSet()); return ImmutableServerListConfig.builder() .from(config) .servers(serversWithNamespaces) .build(); } }
public static ServerListConfig namespaceUris(ServerListConfig config, String namespace) { Set<String> serversWithNamespaces = config .servers() .stream() .map(serverAddress -> serverAddress.replaceAll("/$", "") + "/" + namespace) .collect(Collectors.toSet()); return ImmutableServerListConfig.builder() .from(config) .servers(serversWithNamespaces) .build(); } }
private static Function<ServerListConfig, ServerListConfig> addSslConfigurationToServerListFunction( Optional<SslConfiguration> sslConfiguration) { return serverList -> ImmutableServerListConfig.builder() .from(serverList) .sslConfiguration(getFirstPresentOptional(serverList.sslConfiguration(), sslConfiguration)) .build(); }
private static Function<ServerListConfig, ServerListConfig> addSslConfigurationToServerListFunction( Optional<SslConfiguration> sslConfiguration) { return serverList -> ImmutableServerListConfig.builder() .from(serverList) .sslConfiguration(getFirstPresentOptional(serverList.sslConfiguration(), sslConfiguration)) .build(); }