@Test public void succeedDeserializeConfigList() { configRequest = test.deserialize(TestConstants.CONFIG_LIST); configList = configRequest.getComprehendConfigurations(); assertEquals(2, configList.size()); ComprehendConfiguration object1 = configList.get(0); assertEquals(TestConstants.FIELD_NAME, object1.getFieldName()); assertEquals(TestConstants.COMPREHEND_OPERATIONS, object1.getComprehendOperations()); assertEquals(TestConstants.LANGUAGE_CODE, object1.getLanguageCode()); ComprehendConfiguration object2 = configList.get(1); assertEquals(TestConstants.NEW_FIELD_NAME, object2.getFieldName()); assertEquals(TestConstants.NEW_OPERATIONS, object2.getComprehendOperations()); assertEquals(TestConstants.NEW_LANGUAGE_CODE, object2.getLanguageCode()); }
public PreprocessingConfigRequest deserialize(@NonNull final String input) throws InvalidRequestException { if (input.isEmpty()) { throw new InvalidRequestException(CustomerMessage.INPUT_NULL_OR_EMPTY_ERROR); } ObjectReader objectReader = mapper.readerFor(new TypeReference<PreprocessingConfigRequest>() {}); try { JsonNode configJson = mapper.readTree(input); return objectReader.readValue(configJson); } catch (IOException e) { throw new InvalidRequestException(CustomerMessage.CONFIG_MALFORMED_ERROR, e); } }
ConfigSerializer implements ComprehendSerializer<PreprocessingConfigRequest> { public PreprocessingConfigRequest deserialize(@NonNull final String input) throws InvalidRequestException { if (input.isEmpty()) { throw new InvalidRequestException(CustomerMessage.INPUT_NULL_OR_EMPTY_ERROR); } ObjectReader objectReader = mapper.readerFor(new TypeReference<PreprocessingConfigRequest>() {}); try { JsonNode configJson = mapper.readTree(input); return objectReader.readValue(configJson); } catch (IOException e) { throw new InvalidRequestException(CustomerMessage.CONFIG_MALFORMED_ERROR, e); } } }
ConfigSerializer implements ComprehendSerializer<PreprocessingConfigRequest> { public PreprocessingConfigRequest deserialize(@NonNull final String input) throws InvalidRequestException { if (input.isEmpty()) { throw new InvalidRequestException(CustomerMessage.INPUT_NULL_OR_EMPTY_ERROR); } ObjectReader objectReader = mapper.readerFor(new TypeReference<PreprocessingConfigRequest>() {}); try { JsonNode configJson = mapper.readTree(input); return objectReader.readValue(configJson); } catch (IOException e) { throw new InvalidRequestException(CustomerMessage.CONFIG_MALFORMED_ERROR, e); } }  }
ConfigSerializer implements ComprehendSerializer<PreprocessingConfigRequest> { public PreprocessingConfigRequest deserialize(@NonNull final String input) throws InvalidRequestException { if (input.isEmpty()) { throw new InvalidRequestException(CustomerMessage.INPUT_NULL_OR_EMPTY_ERROR); } ObjectReader objectReader = mapper.readerFor(new TypeReference<PreprocessingConfigRequest>() {}); try { JsonNode configJson = mapper.readTree(input); return objectReader.readValue(configJson); } catch (IOException e) { throw new InvalidRequestException(CustomerMessage.CONFIG_MALFORMED_ERROR, e); } }  PreprocessingConfigRequest deserialize(@NonNull final String input); String serialize(@NonNull PreprocessingConfigRequest configRequest); static Map<String, ComprehendConfiguration> transformConfigRequestToConfigMap(
            @NonNull PreprocessingConfigRequest configRequest); static PreprocessingConfigRequest transformConfigMapToConfigRequest(
            @NonNull Map<String, ComprehendConfiguration> configMap); }
ConfigSerializer implements ComprehendSerializer<PreprocessingConfigRequest> { public PreprocessingConfigRequest deserialize(@NonNull final String input) throws InvalidRequestException { if (input.isEmpty()) { throw new InvalidRequestException(CustomerMessage.INPUT_NULL_OR_EMPTY_ERROR); } ObjectReader objectReader = mapper.readerFor(new TypeReference<PreprocessingConfigRequest>() {}); try { JsonNode configJson = mapper.readTree(input); return objectReader.readValue(configJson); } catch (IOException e) { throw new InvalidRequestException(CustomerMessage.CONFIG_MALFORMED_ERROR, e); } }  PreprocessingConfigRequest deserialize(@NonNull final String input); String serialize(@NonNull PreprocessingConfigRequest configRequest); static Map<String, ComprehendConfiguration> transformConfigRequestToConfigMap(
            @NonNull PreprocessingConfigRequest configRequest); static PreprocessingConfigRequest transformConfigMapToConfigRequest(
            @NonNull Map<String, ComprehendConfiguration> configMap);  }