Package org.apache.flink.types
Class PojoTestUtils
- java.lang.Object
-
- org.apache.flink.types.PojoTestUtils
-
@PublicEvolving public class PojoTestUtils extends Object
Test utils around POJOs.
-
-
Constructor Summary
Constructors Constructor Description PojoTestUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T> voidassertSerializedAsPojo(Class<T> clazz)Verifies that instances of the given class fulfill all conditions to be serialized with thePojoSerializer, as documented here.static <T> voidassertSerializedAsPojoWithoutKryo(Class<T> clazz)Verifies that instances of the given class fulfill all conditions to be serialized with thePojoSerializer, as documented here, without any field being serialized with Kryo.
-
-
-
Method Detail
-
assertSerializedAsPojo
public static <T> void assertSerializedAsPojo(Class<T> clazz) throws AssertionError
Verifies that instances of the given class fulfill all conditions to be serialized with thePojoSerializer, as documented here.Note that this check will succeed even if the Pojo is partially serialized with Kryo. If this is not desired, use
assertSerializedAsPojoWithoutKryo(Class)instead.- Type Parameters:
T- class type- Parameters:
clazz- class to analyze- Throws:
AssertionError- if instances of the class cannot be serialized as a POJO
-
assertSerializedAsPojoWithoutKryo
public static <T> void assertSerializedAsPojoWithoutKryo(Class<T> clazz) throws AssertionError
Verifies that instances of the given class fulfill all conditions to be serialized with thePojoSerializer, as documented here, without any field being serialized with Kryo.- Type Parameters:
T- class type- Parameters:
clazz- class to analyze- Throws:
AssertionError- if instances of the class cannot be serialized as a POJO or required Kryo for one or more fields
-
-