Interface EntityObjectMapper.Builder
- Enclosing class:
EntityObjectMapper
public static interface EntityObjectMapper.Builder
Builds a
EntityObjectMapper.
The parameter and return types of functions, procedures and reports are registered for the
ones called or filled over a JSON connection, their type parameters erased at runtime, leaving
nothing to deserialize a value as, and a type name on the wire would be a type name the client
resolves, which is what JSON avoids. A generic type is registered via a TypeReference,
new TypeReference<List<Track>>() {}, whose type arguments, unlike those of a Class,
survive to the deserialization site.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceThe first step in building aEntityObjectMapper -
Method Summary
Modifier and TypeMethodDescriptionbuild()deserializer(Class<T> type, com.fasterxml.jackson.databind.deser.std.StdDeserializer<? extends T> deserializer) Adds a deserializer for the given type, replacing any previously added one.includeForeignKeyValues(boolean includeForeignKeyValues) includeNullValues(boolean includeNullValues) <P extends @Nullable Object>
EntityObjectMapper.Builderparameter(FunctionType<?, P, ?> functionType, com.fasterxml.jackson.core.type.TypeReference<@NonNull P> type) Registers the generic type the given function's parameter is deserialized as, replacing any previously registered one.<P extends @Nullable Object>
EntityObjectMapper.Builderparameter(FunctionType<?, P, ?> functionType, Class<@NonNull P> type) Registers the type the given function's parameter is deserialized as, replacing any previously registered one.<P extends @Nullable Object>
EntityObjectMapper.Builderparameter(ProcedureType<?, P> procedureType, com.fasterxml.jackson.core.type.TypeReference<@NonNull P> type) Registers the generic type the given procedure's parameter is deserialized as, replacing any previously registered one.<P extends @Nullable Object>
EntityObjectMapper.Builderparameter(ProcedureType<?, P> procedureType, Class<@NonNull P> type) Registers the type the given procedure's parameter is deserialized as, replacing any previously registered one.<P extends @Nullable Object>
EntityObjectMapper.Builderparameter(ReportType<P, ?> reportType, com.fasterxml.jackson.core.type.TypeReference<@NonNull P> type) Registers the generic type the given report's parameter is deserialized as, replacing any previously registered one.<P extends @Nullable Object>
EntityObjectMapper.Builderparameter(ReportType<P, ?> reportType, Class<@NonNull P> type) Registers the type the given report's parameter is deserialized as, replacing any previously registered one.<R extends @Nullable Object>
EntityObjectMapper.BuilderreturnType(FunctionType<?, ?, R> functionType, com.fasterxml.jackson.core.type.TypeReference<@NonNull R> type) Registers the generic type the given function's return value is serialized as and deserialized from, replacing any previously registered one.<R extends @Nullable Object>
EntityObjectMapper.BuilderreturnType(FunctionType<?, ?, R> functionType, Class<@NonNull R> type) Registers the type the given function's return value is serialized as and deserialized from, replacing any previously registered one.returnType(ReportType<?, R> reportType, com.fasterxml.jackson.core.type.TypeReference<R> type) Registers the generic type the given report's result is serialized as and deserialized from, replacing any previously registered one.returnType(ReportType<?, R> reportType, Class<R> type) Registers the type the given report's result is serialized as and deserialized from, replacing any previously registered one.serializer(Class<? extends T> type, com.fasterxml.jackson.databind.ser.std.StdSerializer<T> serializer) Adds a serializer for the given type, replacing any previously added one.
-
Method Details
-
includeForeignKeyValues
- Parameters:
includeForeignKeyValues- true if the entities referenced via foreign keys should be included in serialized entities- Returns:
- this builder instance
-
includeNullValues
- Parameters:
includeNullValues- true if null values should be included in serialized entities- Returns:
- this builder instance
-
serializer
<T> EntityObjectMapper.Builder serializer(Class<? extends T> type, com.fasterxml.jackson.databind.ser.std.StdSerializer<T> serializer) Adds a serializer for the given type, replacing any previously added one.- Type Parameters:
T- the type- Parameters:
type- the typeserializer- the serializer- Returns:
- this builder instance
-
deserializer
<T> EntityObjectMapper.Builder deserializer(Class<T> type, com.fasterxml.jackson.databind.deser.std.StdDeserializer<? extends T> deserializer) Adds a deserializer for the given type, replacing any previously added one.- Type Parameters:
T- the type- Parameters:
type- the typedeserializer- the deserializer- Returns:
- this builder instance
-
parameter
<P extends @Nullable Object> EntityObjectMapper.Builder parameter(ProcedureType<?, P> procedureType, Class<@NonNull P> type) Registers the type the given procedure's parameter is deserialized as, replacing any previously registered one.- Type Parameters:
P- the procedure parameter type- Parameters:
procedureType- the procedure typetype- the parameter type, that of the non-null value- Returns:
- this builder instance
-
parameter
<P extends @Nullable Object> EntityObjectMapper.Builder parameter(ProcedureType<?, P> procedureType, com.fasterxml.jackson.core.type.TypeReference<@NonNull P> type) Registers the generic type the given procedure's parameter is deserialized as, replacing any previously registered one.- Type Parameters:
P- the procedure parameter type- Parameters:
procedureType- the procedure typetype- the parameter type, that of the non-null value- Returns:
- this builder instance
-
parameter
<P extends @Nullable Object> EntityObjectMapper.Builder parameter(FunctionType<?, P, ?> functionType, Class<@NonNull P> type) Registers the type the given function's parameter is deserialized as, replacing any previously registered one.- Type Parameters:
P- the function parameter type- Parameters:
functionType- the function typetype- the parameter type, that of the non-null value- Returns:
- this builder instance
- See Also:
-
parameter
<P extends @Nullable Object> EntityObjectMapper.Builder parameter(FunctionType<?, P, ?> functionType, com.fasterxml.jackson.core.type.TypeReference<@NonNull P> type) Registers the generic type the given function's parameter is deserialized as, replacing any previously registered one.- Type Parameters:
P- the function parameter type- Parameters:
functionType- the function typetype- the parameter type, that of the non-null value- Returns:
- this builder instance
- See Also:
-
parameter
<P extends @Nullable Object> EntityObjectMapper.Builder parameter(ReportType<P, ?> reportType, Class<@NonNull P> type) Registers the type the given report's parameter is deserialized as, replacing any previously registered one.- Type Parameters:
P- the report parameter type- Parameters:
reportType- the report typetype- the parameter type, that of the non-null value- Returns:
- this builder instance
- See Also:
-
parameter
<P extends @Nullable Object> EntityObjectMapper.Builder parameter(ReportType<P, ?> reportType, com.fasterxml.jackson.core.type.TypeReference<@NonNull P> type) Registers the generic type the given report's parameter is deserialized as, replacing any previously registered one.- Type Parameters:
P- the report parameter type- Parameters:
reportType- the report typetype- the parameter type, that of the non-null value- Returns:
- this builder instance
- See Also:
-
returnType
<R extends @Nullable Object> EntityObjectMapper.Builder returnType(FunctionType<?, ?, R> functionType, Class<@NonNull R> type) Registers the type the given function's return value is serialized as and deserialized from, replacing any previously registered one. A function called over a JSON connection requires one.- Type Parameters:
R- the function return type- Parameters:
functionType- the function typetype- the return type, that of the non-null value- Returns:
- this builder instance
- See Also:
-
returnType
<R extends @Nullable Object> EntityObjectMapper.Builder returnType(FunctionType<?, ?, R> functionType, com.fasterxml.jackson.core.type.TypeReference<@NonNull R> type) Registers the generic type the given function's return value is serialized as and deserialized from, replacing any previously registered one. A function called over a JSON connection requires one.- Type Parameters:
R- the function return type- Parameters:
functionType- the function typetype- the return type, that of the non-null value- Returns:
- this builder instance
- See Also:
-
returnType
Registers the type the given report's result is serialized as and deserialized from, replacing any previously registered one. A report filled over a JSON connection requires one, a report exported to abyte[], a PDF for example, registeringbyte[].class.- Type Parameters:
R- the report result type- Parameters:
reportType- the report typetype- the result type- Returns:
- this builder instance
- See Also:
-
returnType
<R> EntityObjectMapper.Builder returnType(ReportType<?, R> reportType, com.fasterxml.jackson.core.type.TypeReference<R> type) Registers the generic type the given report's result is serialized as and deserialized from, replacing any previously registered one. A report filled over a JSON connection requires one.- Type Parameters:
R- the report result type- Parameters:
reportType- the report typetype- the result type- Returns:
- this builder instance
- See Also:
-
build
EntityObjectMapper build()- Returns:
- a new
EntityObjectMapperinstance based on this builder
-