Merge pull request #17289 from nosan

* gh-17289:
  Polish WebServiceTemplateBuilder

Closes gh-17289
pull/17391/head
Andy Wilkinson 5 years ago
commit c982289431

@ -473,8 +473,8 @@ public class WebServiceTemplateBuilder {
private void applyCustomizers(WebServiceTemplate webServiceTemplate, private void applyCustomizers(WebServiceTemplate webServiceTemplate,
Set<WebServiceTemplateCustomizer> customizers) { Set<WebServiceTemplateCustomizer> customizers) {
if (!CollectionUtils.isEmpty(customizers)) { if (!CollectionUtils.isEmpty(customizers)) {
for (WebServiceTemplateCustomizer internalCustomizer : customizers) { for (WebServiceTemplateCustomizer customizer : customizers) {
internalCustomizer.customize(webServiceTemplate); customizer.customize(webServiceTemplate);
} }
} }
} }
@ -505,13 +505,13 @@ public class WebServiceTemplateBuilder {
* Collect user-defined {@link WebServiceMessageSender} and whether only additional * Collect user-defined {@link WebServiceMessageSender} and whether only additional
* message senders were added or not. * message senders were added or not.
*/ */
private static class WebServiceMessageSenders { private static final class WebServiceMessageSenders {
private final boolean onlyAdditional; private final boolean onlyAdditional;
private Set<WebServiceMessageSender> messageSenders; private Set<WebServiceMessageSender> messageSenders;
WebServiceMessageSenders() { private WebServiceMessageSenders() {
this(true, Collections.emptySet()); this(true, Collections.emptySet());
} }
@ -520,19 +520,19 @@ public class WebServiceTemplateBuilder {
this.messageSenders = messageSenders; this.messageSenders = messageSenders;
} }
public boolean isOnlyAdditional() { boolean isOnlyAdditional() {
return this.onlyAdditional; return this.onlyAdditional;
} }
public Set<WebServiceMessageSender> getMessageSenders() { Set<WebServiceMessageSender> getMessageSenders() {
return this.messageSenders; return this.messageSenders;
} }
public WebServiceMessageSenders set(Collection<? extends WebServiceMessageSender> messageSenders) { WebServiceMessageSenders set(Collection<? extends WebServiceMessageSender> messageSenders) {
return new WebServiceMessageSenders(false, new LinkedHashSet<>(messageSenders)); return new WebServiceMessageSenders(false, new LinkedHashSet<>(messageSenders));
} }
public WebServiceMessageSenders add(Collection<? extends WebServiceMessageSender> messageSenders) { WebServiceMessageSenders add(Collection<? extends WebServiceMessageSender> messageSenders) {
return new WebServiceMessageSenders(this.onlyAdditional, append(this.messageSenders, messageSenders)); return new WebServiceMessageSenders(this.onlyAdditional, append(this.messageSenders, messageSenders));
} }
@ -540,7 +540,8 @@ public class WebServiceTemplateBuilder {
/** /**
* {@link WebServiceTemplateCustomizer} to set * {@link WebServiceTemplateCustomizer} to set
* {@link WebServiceTemplate#checkConnectionForFault checkConnectionForFault }. * {@link WebServiceTemplate#setCheckConnectionForFault(boolean)
* checkConnectionForFault}.
*/ */
private static final class CheckConnectionFaultCustomizer implements WebServiceTemplateCustomizer { private static final class CheckConnectionFaultCustomizer implements WebServiceTemplateCustomizer {
@ -559,7 +560,8 @@ public class WebServiceTemplateBuilder {
/** /**
* {@link WebServiceTemplateCustomizer} to set * {@link WebServiceTemplateCustomizer} to set
* {@link WebServiceTemplate#checkConnectionForError checkConnectionForError }. * {@link WebServiceTemplate#setCheckConnectionForError(boolean)
* checkConnectionForError}.
*/ */
private static final class CheckConnectionForErrorCustomizer implements WebServiceTemplateCustomizer { private static final class CheckConnectionForErrorCustomizer implements WebServiceTemplateCustomizer {
@ -578,7 +580,8 @@ public class WebServiceTemplateBuilder {
/** /**
* {@link WebServiceTemplateCustomizer} to set * {@link WebServiceTemplateCustomizer} to set
* {@link WebServiceTemplate#faultMessageResolver faultMessageResolver }. * {@link WebServiceTemplate#setFaultMessageResolver(FaultMessageResolver)
* faultMessageResolver}.
*/ */
private static final class FaultMessageResolverCustomizer implements WebServiceTemplateCustomizer { private static final class FaultMessageResolverCustomizer implements WebServiceTemplateCustomizer {

Loading…
Cancel
Save