Skip to content

Commit

Permalink
format codes for checkstyle.
Browse files Browse the repository at this point in the history
  • Loading branch information
VictorZeng authored and wenshao committed May 24, 2022
1 parent 97c2f0d commit f10de5c
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,4 @@ public void setSerializedPayloadClass(Class<?> payloadClass) {
Assert.isTrue(byte[].class == payloadClass,
() -> "Payload class must be byte[] : " + payloadClass);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -62,18 +62,12 @@ protected Object convertFromInternal(Message<?> message, Class<?> targetClass, O
Object payload = message.getPayload();

if (payload instanceof byte[] && fastJsonConfig.isJsonb()) {

obj = JSONB.parseObject((byte[]) payload, type, fastJsonConfig.getSymbolTable(), fastJsonConfig.getReaderFeatures());

} else if (payload instanceof byte[] && !fastJsonConfig.isJsonb()) {

obj = JSON.parseObject((byte[]) payload, type, fastJsonConfig.getDateFormat(), fastJsonConfig.getReaderFeatures());

} else if (payload instanceof String && JSON.isValid((String) payload)) {

obj = JSON.parseObject((String) payload, type, fastJsonConfig.getDateFormat(), fastJsonConfig.getReaderFeatures());
}

return obj;
}

Expand All @@ -83,35 +77,22 @@ protected Object convertToInternal(Object payload, MessageHeaders headers, Objec
Object obj = null;

if (byte[].class == getSerializedPayloadClass()) {

if (payload instanceof String && fastJsonConfig.isJsonb()) {

obj = JSONB.fromJSONString((String) payload);

} else if (payload instanceof String && !fastJsonConfig.isJsonb()) {

obj = ((String) payload).getBytes(fastJsonConfig.getCharset());

} else if (fastJsonConfig.isJsonb()) {

obj = JSONB.toBytes(payload, fastJsonConfig.getSymbolTable(), fastJsonConfig.getWriterFeatures());

} else {

obj = JSON.toJSONBytes(payload, fastJsonConfig.getDateFormat(), fastJsonConfig.getWriterFilters(), fastJsonConfig.getWriterFeatures());
}
} else if (String.class == getSerializedPayloadClass()) {

if (payload instanceof String && JSON.isValid((String) payload)) {

obj = payload;

} else {

obj = JSON.toJSONString(payload, fastJsonConfig.getDateFormat(), fastJsonConfig.getWriterFilters(), fastJsonConfig.getWriterFeatures());
}
}

return obj;
}

Expand Down

0 comments on commit f10de5c

Please sign in to comment.