@Test(dataProvider = "conversionTestData") public void testConversion(Object value, Object expectedConvertedValue) throws JsonProcessingException { Object convertedValue = JSONRecordExtractorUtils.convertValue(value); Assert.assertEquals(JsonUtils.objectToString(convertedValue), JsonUtils.objectToString(expectedConvertedValue)); }
public static Object convertValue(Object value) { if (value == null) { return null; } Object convertedValue; if (value instanceof Collection) { convertedValue = convertMultiValue((Collection) value); } else if (value instanceof Map) { convertedValue = convertMap((Map) value); } else { if (value instanceof Number) { convertedValue = value; } else { convertedValue = value.toString(); } } return convertedValue; }
JSONRecordExtractorUtils { public static Object convertValue(Object value) { if (value == null) { return null; } Object convertedValue; if (value instanceof Collection) { convertedValue = convertMultiValue((Collection) value); } else if (value instanceof Map) { convertedValue = convertMap((Map) value); } else { if (value instanceof Number) { convertedValue = value; } else { convertedValue = value.toString(); } } return convertedValue; } }
JSONRecordExtractorUtils { public static Object convertValue(Object value) { if (value == null) { return null; } Object convertedValue; if (value instanceof Collection) { convertedValue = convertMultiValue((Collection) value); } else if (value instanceof Map) { convertedValue = convertMap((Map) value); } else { if (value instanceof Number) { convertedValue = value; } else { convertedValue = value.toString(); } } return convertedValue; } private  JSONRecordExtractorUtils(); }
JSONRecordExtractorUtils { public static Object convertValue(Object value) { if (value == null) { return null; } Object convertedValue; if (value instanceof Collection) { convertedValue = convertMultiValue((Collection) value); } else if (value instanceof Map) { convertedValue = convertMap((Map) value); } else { if (value instanceof Number) { convertedValue = value; } else { convertedValue = value.toString(); } } return convertedValue; } private  JSONRecordExtractorUtils(); static Object convertValue(Object value); }
JSONRecordExtractorUtils { public static Object convertValue(Object value) { if (value == null) { return null; } Object convertedValue; if (value instanceof Collection) { convertedValue = convertMultiValue((Collection) value); } else if (value instanceof Map) { convertedValue = convertMap((Map) value); } else { if (value instanceof Number) { convertedValue = value; } else { convertedValue = value.toString(); } } return convertedValue; } private  JSONRecordExtractorUtils(); static Object convertValue(Object value);  }