com.amazonaws.services.lambda.runtime.CustomPojoSerializer Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of aws-lambda-java-core Show documentation
Show all versions of aws-lambda-java-core Show documentation
Minimal set of interface definitions for Java support in AWS Lambda
/* Copyright 2022 Amazon.com, Inc. or its affiliates. All Rights Reserved. */
package com.amazonaws.services.lambda.runtime;
import java.io.InputStream;
import java.io.OutputStream;
import java.lang.reflect.Type;
/**
* Interface required to implement a custom plain old java objects serializer
*/
public interface CustomPojoSerializer {
/**
* Deserializes from input stream to plain old java object
* @param input input stream
* @param type plain old java object type
* @return deserialized plain old java object of type T
*/
T fromJson(InputStream input, Type type);
/**
* Deserializes from String to plain old java object
* @param input input string
* @param type plain old java object type
* @return deserialized plain old java object of type T
*/
T fromJson(String input, Type type);
/**
* Serializes plain old java object to output stream
* @param value instance of type T to be serialized
* @param output OutputStream to serialize plain old java object to
* @param type plain old java object type
*/
void toJson(T value, OutputStream output, Type type);
}