/** * Sets the URIs of the service. * * @param urls The URIs */ public void setUrls(List<URI> urls) { if (CollectionUtils.isNotEmpty(urls)) { this.urls = urls; } }
/** * @param checks The list of Http checks */ protected void setChecks(List<HTTPCheck> checks) { if (CollectionUtils.isNotEmpty(checks)) { this.checks.addAll(checks); } } }
/** * @param typeHandlers The Netty customizable response type handlers */ @Inject public DefaultCustomizableResponseTypeHandlerRegistry(List<NettyCustomizableResponseTypeHandler> typeHandlers) { this.handlers = CollectionUtils.isNotEmpty(typeHandlers) ? typeHandlers : Collections.emptyList(); }
/** * The default server loadbalance resolver. * * @param beanContext The bean context * @param serviceInstanceLists Any other providers */ @Inject public DefaultLoadBalancerResolver( BeanContext beanContext, List<ServiceInstanceList> serviceInstanceLists) { this.beanContext = beanContext; if (CollectionUtils.isNotEmpty(serviceInstanceLists)) { this.serviceInstanceLists = new HashMap<>(serviceInstanceLists.size()); for (ServiceInstanceList provider : serviceInstanceLists) { this.serviceInstanceLists.put(provider.getID(), provider); } } else { this.serviceInstanceLists = Collections.emptyMap(); } }
@Override public HealthStatus getHealthStatus() { List<Check> checks = healthEntry.getChecks(); if (CollectionUtils.isNotEmpty(checks)) { Stream<Check> criticalStream = checks.stream().filter(c -> c.status() == Check.Status.CRITICAL); Optional<Check> first = criticalStream.findFirst(); if (first.isPresent()) { Check check = first.get(); String notes = check.getNotes(); if (StringUtils.isNotEmpty(notes)) { return HealthStatus.DOWN.describe(notes); } else { return HealthStatus.DOWN; } } } return HealthStatus.UP; }
@Override public ConvertibleValues<String> getMetadata() { if (instanceMetadata == null) { Map<String, String> cloudMetadata = new HashMap<>(); if (computeInstanceMetadataResolver != null) { Optional<? extends ComputeInstanceMetadata> resolved = computeInstanceMetadataResolver.resolve(environment); if (resolved.isPresent()) { cloudMetadata = resolved.get().getMetadata(); } } if (CollectionUtils.isNotEmpty(metadataContributors)) { for (ServiceInstanceMetadataContributor metadataContributor : metadataContributors) { metadataContributor.contribute(this, cloudMetadata); } } Map<String, String> metadata = nettyHttpServer.getServerConfiguration() .getApplicationConfiguration() .getInstance() .getMetadata(); if (cloudMetadata != null) { cloudMetadata.putAll(metadata); } instanceMetadata = ConvertibleValues.of(cloudMetadata); } return instanceMetadata; } }
((MutableHttpRequest<I>) request).uri(requestURI); if (CollectionUtils.isNotEmpty(filters)) { List<HttpClientFilter> httpClientFilters = resolveFilters(parentRequest, request, requestURI); OrderUtil.reverseSort(httpClientFilters);
this.conversionService = conversionService; if (CollectionUtils.isNotEmpty(binders)) { for (RequestArgumentBinder binder : binders) { if (binder instanceof AnnotatedRequestArgumentBinder) {
/** * Sets the object mapper features to use. * @param mapper The object mapper features */ public void setMapper(Map<MapperFeature, Boolean> mapper) { if (CollectionUtils.isNotEmpty(mapper)) { this.mapper = mapper; } }
/** * Sets the parser features to use. * @param parser The parser features */ public void setParser(Map<JsonParser.Feature, Boolean> parser) { if (CollectionUtils.isNotEmpty(parser)) { this.parser = parser; } }
/** * Sets the generator features to use. * @param generator The generator features */ public void setGenerator(Map<JsonGenerator.Feature, Boolean> generator) { if (CollectionUtils.isNotEmpty(generator)) { this.generator = generator; } }
/** * Sets the URIs of the service. * * @param urls The URIs */ public void setUrls(List<URI> urls) { if (CollectionUtils.isNotEmpty(urls)) { this.urls = urls; } }
/** * Sets the URIs of the service. * * @param urls The URIs */ public void setUrls(List<URI> urls) { if (CollectionUtils.isNotEmpty(urls)) { this.urls = urls; } }
/** * A list of paths either starting with `classpath:` or `file:`. You can serve files from anywhere on disk or the classpath. For example to serve static resources from `src/main/resources/public`, you would use `classpath:public` as the path. * * @param paths The paths */ public void setPaths(List<String> paths) { if (CollectionUtils.isNotEmpty(paths)) { this.paths = paths; } }
/** * Sets the serialization features to use. * @param serialization The serialization features. */ public void setSerialization(Map<SerializationFeature, Boolean> serialization) { if (CollectionUtils.isNotEmpty(serialization)) { this.serialization = serialization; } }
/** * Sets the deserialization features to use. * @param deserialization The deserialiation features. */ public void setDeserialization(Map<DeserializationFeature, Boolean> deserialization) { if (CollectionUtils.isNotEmpty(deserialization)) { this.deserialization = deserialization; } }
/** * Add a property source for the given map. * * @param name The name of the property source * @param values The values * @return This environment */ public PropertySourcePropertyResolver addPropertySource(String name, @Nullable Map<String, ? super Object> values) { if (CollectionUtils.isNotEmpty(values)) { return addPropertySource(PropertySource.of(name, values)); } return this; }
/** * Add a property source for the given map. * * @param name The name of the property source * @param values The values * @return This environment */ public PropertySourcePropertyResolver addPropertySource(String name, @Nullable Map<String, ? super Object> values) { if (CollectionUtils.isNotEmpty(values)) { return addPropertySource(PropertySource.of(name, values)); } return this; }
/** * Add a property source for the given map. * * @param name The name * @param values The values * @return This environment */ default Environment addPropertySource(String name, @Nullable Map<String, ? super Object> values) { if (StringUtils.isNotEmpty(name) && CollectionUtils.isNotEmpty(values)) { return addPropertySource(PropertySource.of(name, values)); } return this; }
/** * Add a property source for the given map. * * @param name The name * @param values The values * @return This environment */ default Environment addPropertySource(String name, @Nullable Map<String, ? super Object> values) { if (StringUtils.isNotEmpty(name) && CollectionUtils.isNotEmpty(values)) { return addPropertySource(PropertySource.of(name, values)); } return this; }