mapperClass

Expanders 3.2.1

A <dataElement>Mapper class will be generated in the shared layer for each dataElement.

This class implements the IDataElementMapper class, which defines the following 2 methods:

  1. Result<Map<String, String>> convertToMap(ParameterContext<DETAILS> parameter)
  2. Result<DETAILS> convertToDetails(ParameterContext<Map<String, String>> parameter)

These methods can be used to map between details and key-value pairs.

Conversion

The following field types are supported:

  • String: conversion is trivial
  • Numbers(Integer, double…) and Boolean: converted through the valueOf methods of their respective classes and String
  • DataRef: converted to and from name field
  • Date and DateLong: converted according to ISO 8601 standard
  • ValueType: converted with their specific Converter-classes
  • byte[]: converted using base64-encoding

Future implementations may use functional keys instead of names when converting dataRef’s

References