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:
  • Method Details

    • includeForeignKeyValues

      EntityObjectMapper.Builder includeForeignKeyValues(boolean includeForeignKeyValues)
      Parameters:
      includeForeignKeyValues - true if the entities referenced via foreign keys should be included in serialized entities
      Returns:
      this builder instance
    • includeNullValues

      EntityObjectMapper.Builder includeNullValues(boolean 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 type
      serializer - 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 type
      deserializer - 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 type
      type - 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 type
      type - 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 type
      type - 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 type
      type - 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 type
      type - 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 type
      type - 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 type
      type - 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 type
      type - the return type, that of the non-null value
      Returns:
      this builder instance
      See Also:
    • returnType

      <R> EntityObjectMapper.Builder 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. A report filled over a JSON connection requires one, a report exported to a byte[], a PDF for example, registering byte[].class.
      Type Parameters:
      R - the report result type
      Parameters:
      reportType - the report type
      type - 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 type
      type - the result type
      Returns:
      this builder instance
      See Also:
    • build

      Returns:
      a new EntityObjectMapper instance based on this builder