@Test public void failDeserializeOnEmptyConfigList() { try { configRequest = test.deserialize(TestConstants.EMPTY_CONFIG_LIST); } catch (InvalidRequestException e) { assertEquals(CustomerMessage.CONFIG_MALFORMED_ERROR, e.getMessage()); } }
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);  }