@Test void studioTypes(final JsonBuilderFactory jsonBuilderFactory, final JsonProvider jsonProvider, final RecordBuilderFactory recordBuilderFactory, final RecordConverters converter) throws Exception { final SimpleRowStruct record = new SimpleRowStruct(); record.character = 'a'; record.character2 = 'a'; record.notLong = 100; record.notLong2 = 100; record.binary = 100; record.binary2 = 100; record.bd = BigDecimal.TEN; record.today = new Date(0); try (final Jsonb jsonb = JsonbBuilder .create(new JsonbConfig().withPropertyOrderStrategy(PropertyOrderStrategy.LEXICOGRAPHICAL))) { final Record recordModel = Record.class .cast(converter .toType(new RecordConverters.MappingMetaRegistry(), record, Record.class, () -> jsonBuilderFactory, () -> jsonProvider, () -> jsonb, () -> recordBuilderFactory)); assertEquals( "{\"bd\":10.0,\"binary\":100.0,\"binary2\":100.0," + "\"character\":\"a\",\"character2\":\"a\"," + "\"notLong\":100.0,\"notLong2\":100.0," + "\"today\":\"1970-01-01T00:00:00Z[UTC]\"}", recordModel.toString()); final SimpleRowStruct deserialized = SimpleRowStruct.class .cast(converter .toType(new RecordConverters.MappingMetaRegistry(), recordModel, SimpleRowStruct.class, () -> jsonBuilderFactory, () -> jsonProvider, () -> jsonb, () -> recordBuilderFactory)); if (record.bd.doubleValue() == deserialized.bd.doubleValue()) { deserialized.bd = record.bd; } assertEquals(record, deserialized); } }
public Object toType(final MappingMetaRegistry registry, final Object data, final Class<?> parameterType, final Supplier<JsonBuilderFactory> factorySupplier, final Supplier<JsonProvider> providerSupplier, final Supplier<Jsonb> jsonbProvider, final Supplier<RecordBuilderFactory> recordBuilderProvider) { return toType(registry, data, parameterType, factorySupplier, providerSupplier, jsonbProvider, recordBuilderProvider, Collections.emptyMap()); }
RecordConverters implements Serializable { public Object toType(final MappingMetaRegistry registry, final Object data, final Class<?> parameterType, final Supplier<JsonBuilderFactory> factorySupplier, final Supplier<JsonProvider> providerSupplier, final Supplier<Jsonb> jsonbProvider, final Supplier<RecordBuilderFactory> recordBuilderProvider) { return toType(registry, data, parameterType, factorySupplier, providerSupplier, jsonbProvider, recordBuilderProvider, Collections.emptyMap()); } }
RecordConverters implements Serializable { public Object toType(final MappingMetaRegistry registry, final Object data, final Class<?> parameterType, final Supplier<JsonBuilderFactory> factorySupplier, final Supplier<JsonProvider> providerSupplier, final Supplier<Jsonb> jsonbProvider, final Supplier<RecordBuilderFactory> recordBuilderProvider) { return toType(registry, data, parameterType, factorySupplier, providerSupplier, jsonbProvider, recordBuilderProvider, Collections.emptyMap()); }  }
RecordConverters implements Serializable { public Object toType(final MappingMetaRegistry registry, final Object data, final Class<?> parameterType, final Supplier<JsonBuilderFactory> factorySupplier, final Supplier<JsonProvider> providerSupplier, final Supplier<Jsonb> jsonbProvider, final Supplier<RecordBuilderFactory> recordBuilderProvider) { return toType(registry, data, parameterType, factorySupplier, providerSupplier, jsonbProvider, recordBuilderProvider, Collections.emptyMap()); }  T mapNumber(final Class<T> expected, final Number from); Record toRecord(final MappingMetaRegistry registry, final T data, final Supplier<Jsonb> jsonbProvider,
            final Supplier<RecordBuilderFactory> recordBuilderProvider); static Schema toSchema(final RecordBuilderFactory factory, final Object next); Object toType(final MappingMetaRegistry registry, final Object data, final Class<?> parameterType,
            final Supplier<JsonBuilderFactory> factorySupplier, final Supplier<JsonProvider> providerSupplier,
            final Supplier<Jsonb> jsonbProvider, final Supplier<RecordBuilderFactory> recordBuilderProvider); Object toType(final MappingMetaRegistry registry, final Object data, final Class<?> parameterType,
            final Supplier<JsonBuilderFactory> factorySupplier, final Supplier<JsonProvider> providerSupplier,
            final Supplier<Jsonb> jsonbProvider, final Supplier<RecordBuilderFactory> recordBuilderProvider,
            final java.util.Map<String, String> metadata); T coerce(final Class<T> expectedType, final Object value, final String name); }
RecordConverters implements Serializable { public Object toType(final MappingMetaRegistry registry, final Object data, final Class<?> parameterType, final Supplier<JsonBuilderFactory> factorySupplier, final Supplier<JsonProvider> providerSupplier, final Supplier<Jsonb> jsonbProvider, final Supplier<RecordBuilderFactory> recordBuilderProvider) { return toType(registry, data, parameterType, factorySupplier, providerSupplier, jsonbProvider, recordBuilderProvider, Collections.emptyMap()); }  T mapNumber(final Class<T> expected, final Number from); Record toRecord(final MappingMetaRegistry registry, final T data, final Supplier<Jsonb> jsonbProvider,
            final Supplier<RecordBuilderFactory> recordBuilderProvider); static Schema toSchema(final RecordBuilderFactory factory, final Object next); Object toType(final MappingMetaRegistry registry, final Object data, final Class<?> parameterType,
            final Supplier<JsonBuilderFactory> factorySupplier, final Supplier<JsonProvider> providerSupplier,
            final Supplier<Jsonb> jsonbProvider, final Supplier<RecordBuilderFactory> recordBuilderProvider); Object toType(final MappingMetaRegistry registry, final Object data, final Class<?> parameterType,
            final Supplier<JsonBuilderFactory> factorySupplier, final Supplier<JsonProvider> providerSupplier,
            final Supplier<Jsonb> jsonbProvider, final Supplier<RecordBuilderFactory> recordBuilderProvider,
            final java.util.Map<String, String> metadata); T coerce(final Class<T> expectedType, final Object value, final String name);  }