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

Class DefaultEncoder

core/src/main/java/feign/codec/DefaultEncoder.java:23–36  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

21import java.lang.reflect.Type;
22
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

no outgoing calls

Tested by

no test coverage detected