MCPcopy Index your code
hub / github.com/OpenFeign/feign / encode

Method encode

core/src/main/java/feign/codec/DefaultEncoder.java:25–35  ·  view source on GitHub ↗
(Object object, Type bodyType, RequestTemplate template)

Source from the content-addressed store, hash-verified

23public class DefaultEncoder implements Encoder {
24
25 @Override
26 public void encode(Object object, Type bodyType, RequestTemplate template) {
27 if (bodyType == String.class) {
28 template.body(object.toString());
29 } else if (bodyType == byte[].class) {
30 template.body((byte[]) object, null);
31 } else if (object != null) {
32 throw new EncodeException(
33 format("%s is not a type supported by this encoder.", object.getClass()));
34 }
35 }
36}

Callers

nothing calls this directly

Calls 3

formatMethod · 0.80
bodyMethod · 0.65
toStringMethod · 0.45

Tested by

no test coverage detected