Fix checkstyles
This commit is contained in:
@@ -101,21 +101,23 @@ public final class AWSLambdaUtils {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings({ "unchecked", "rawtypes" })
|
@SuppressWarnings({ "unchecked", "rawtypes" })
|
||||||
public static Message<byte[]> generateMessage(byte[] payload, Type inputType, boolean isSupplier, JsonMapper jsonMapper, Context context) {
|
public static Message<byte[]> generateMessage(byte[] payload, Type inputType, boolean isSupplier,
|
||||||
|
JsonMapper jsonMapper, Context context) {
|
||||||
if (logger.isInfoEnabled()) {
|
if (logger.isInfoEnabled()) {
|
||||||
logger.info("Received: " + new String(payload, StandardCharsets.UTF_8));
|
logger.info("Received: " + new String(payload, StandardCharsets.UTF_8));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Object structMessage = jsonMapper.fromJson(payload, Object.class);
|
Object structMessage = jsonMapper.fromJson(payload, Object.class);
|
||||||
boolean isApiGateway = structMessage instanceof Map
|
boolean isApiGateway = structMessage instanceof Map
|
||||||
&& (((Map<String, Object>) structMessage).containsKey("httpMethod") ||
|
&& (((Map<String, Object>) structMessage).containsKey("httpMethod")
|
||||||
(((Map<String, Object>) structMessage).containsKey("routeKey") && ((Map) structMessage).containsKey("version")));
|
|| (((Map<String, Object>) structMessage).containsKey("routeKey")
|
||||||
|
&& ((Map) structMessage).containsKey("version")));
|
||||||
|
|
||||||
Message<byte[]> requestMessage;
|
Message<byte[]> requestMessage;
|
||||||
|
|
||||||
MessageBuilder builder = MessageBuilder.withPayload(structMessage instanceof Map msg && msg.containsKey("payload")
|
MessageBuilder builder = MessageBuilder
|
||||||
? ((String) msg.get("payload")).getBytes(StandardCharsets.UTF_8)
|
.withPayload(structMessage instanceof Map msg && msg.containsKey("payload")
|
||||||
|
? ((String) msg.get("payload")).getBytes(StandardCharsets.UTF_8)
|
||||||
: payload);
|
: payload);
|
||||||
if (isApiGateway) {
|
if (isApiGateway) {
|
||||||
builder.setHeader(AWSLambdaUtils.AWS_API_GATEWAY, true);
|
builder.setHeader(AWSLambdaUtils.AWS_API_GATEWAY, true);
|
||||||
|
|||||||
Reference in New Issue
Block a user