diff --git a/spring-geode/src/main/java/org/springframework/geode/core/env/support/CloudCacheService.java b/spring-geode/src/main/java/org/springframework/geode/core/env/support/CloudCacheService.java index 569a8996..6bc3e65a 100644 --- a/spring-geode/src/main/java/org/springframework/geode/core/env/support/CloudCacheService.java +++ b/spring-geode/src/main/java/org/springframework/geode/core/env/support/CloudCacheService.java @@ -89,7 +89,9 @@ public class CloudCacheService extends Service { * @see #withLocators(String) */ public Optional getLocators() { - return Optional.ofNullable(this.locators).filter(StringUtils::hasText); + + return Optional.ofNullable(this.locators) + .filter(StringUtils::hasText); } /** @@ -116,7 +118,9 @@ public class CloudCacheService extends Service { * @see #getGfshUrl() */ public CloudCacheService withGfshUrl(URL gfshUrl) { + this.gfshUrl = gfshUrl; + return this; } @@ -129,7 +133,9 @@ public class CloudCacheService extends Service { * @see #getLocators() */ public CloudCacheService withLocators(String locators) { + this.locators = locators; + return this; } @@ -250,7 +256,8 @@ public class CloudCacheService extends Service { int index = String.valueOf(value).trim().indexOf("["); return index > 0 ? value.trim().substring(0, index).trim() - : (index != 0 && StringUtils.hasText(value) ? value.trim() : DEFAULT_LOCATOR_HOST); + : (index != 0 && StringUtils.hasText(value) ? value.trim() + : DEFAULT_LOCATOR_HOST); } private static int parsePort(String value) { @@ -286,7 +293,10 @@ public class CloudCacheService extends Service { * @return the {@link String name} of the host on which this {@link Locator} is running. */ public String getHost() { - return Optional.ofNullable(this.host).filter(StringUtils::hasText).orElse(DEFAULT_LOCATOR_HOST); + + return Optional.ofNullable(this.host) + .filter(StringUtils::hasText) + .orElse(DEFAULT_LOCATOR_HOST); } /** @@ -297,7 +307,9 @@ public class CloudCacheService extends Service { * @return the {@link Integer port} on which this {@link Locator} is listening. */ public int getPort() { - return Optional.ofNullable(this.port).orElse(DEFAULT_LOCATOR_PORT); + + return Optional.ofNullable(this.port) + .orElse(DEFAULT_LOCATOR_PORT); } @Override