diff --git a/spring-cloud-loadbalancer/src/main/java/org/springframework/cloud/loadbalancer/core/ServiceInstanceListSupplierBuilder.java b/spring-cloud-loadbalancer/src/main/java/org/springframework/cloud/loadbalancer/core/ServiceInstanceListSupplierBuilder.java index 02843f6c..36cf2543 100644 --- a/spring-cloud-loadbalancer/src/main/java/org/springframework/cloud/loadbalancer/core/ServiceInstanceListSupplierBuilder.java +++ b/spring-cloud-loadbalancer/src/main/java/org/springframework/cloud/loadbalancer/core/ServiceInstanceListSupplierBuilder.java @@ -45,6 +45,7 @@ import org.springframework.web.util.UriComponentsBuilder; * * @author Spencer Gibb * @author Olga Maciaszek-Sharma + * @author Zhiguo Chen */ public final class ServiceInstanceListSupplierBuilder { @@ -248,6 +249,19 @@ public final class ServiceInstanceListSupplierBuilder { return this; } + /** + * Support {@link ServiceInstanceListSupplierBuilder} can be added to the expansion implementation of + * {@link ServiceInstanceListSupplier} by this method. + * @param delegateCreator a {@link DelegateCreator} object + * @return the {@link ServiceInstanceListSupplierBuilder} object + */ + public ServiceInstanceListSupplierBuilder with(DelegateCreator delegateCreator) { + if (delegateCreator != null) { + creators.add(delegateCreator); + } + return this; + } + /** * Builds the {@link ServiceInstanceListSupplier} hierarchy. * @param context application context