Class DecoratedQueryMapEncoder

java.lang.Object
io.microsphere.spring.cloud.openfeign.components.DecoratedFeignComponent<feign.QueryMapEncoder>
io.microsphere.spring.cloud.openfeign.components.DecoratedQueryMapEncoder
All Implemented Interfaces:
feign.QueryMapEncoder, Refreshable

public class DecoratedQueryMapEncoder extends DecoratedFeignComponent<feign.QueryMapEncoder> implements feign.QueryMapEncoder
Since:
0.0.1
Author:
韩超, Mercy
  • Constructor Details

    • DecoratedQueryMapEncoder

      public DecoratedQueryMapEncoder(String contextId, org.springframework.cloud.context.named.NamedContextFactory<org.springframework.cloud.openfeign.FeignClientSpecification> contextFactory, org.springframework.cloud.openfeign.FeignClientProperties clientProperties, feign.QueryMapEncoder delegate)
      Constructs a DecoratedQueryMapEncoder wrapping the given QueryMapEncoder delegate.

      Example Usage:

      
       DecoratedQueryMapEncoder encoder = new DecoratedQueryMapEncoder(
           "my-client", contextFactory, clientProperties, new QueryMapEncoder.Default());
       
      Parameters:
      contextId - the Feign client context ID
      contextFactory - the NamedContextFactory for resolving per-client contexts
      clientProperties - the FeignClientProperties for configuration lookup
      delegate - the original QueryMapEncoder to delegate to
  • Method Details

    • componentType

      protected Class<? extends feign.QueryMapEncoder> componentType()
      Returns the configured QueryMapEncoder class from FeignClientProperties.FeignClientConfiguration, falling back to PageableSpringQueryMapEncoder if not configured.

      Example Usage:

      
       Class<? extends QueryMapEncoder> type = decoratedQueryMapEncoder.componentType();
       
      Specified by:
      componentType in class DecoratedFeignComponent<feign.QueryMapEncoder>
      Returns:
      the QueryMapEncoder component type class
    • encode

      public Map<String,Object> encode(Object object)
      Encodes the given object into a query parameter map by delegating to the underlying QueryMapEncoder.

      Example Usage:

      
       Map<String, Object> queryParams = decoratedQueryMapEncoder.encode(myQueryObject);
       
      Specified by:
      encode in interface feign.QueryMapEncoder
      Parameters:
      object - the object to encode as query parameters
      Returns:
      a map of query parameter names to values