Java Code Examples for com.fasterxml.jackson.databind.PropertyNamingStrategy#SNAKE_CASE

The following examples show how to use com.fasterxml.jackson.databind.PropertyNamingStrategy#SNAKE_CASE . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: JsonUtilsTests.java    From vividus with Apache License 2.0 5 votes vote down vote up
@Test
void testToObjectListSuccess()
{
    jsonUtils = new JsonUtils(PropertyNamingStrategy.SNAKE_CASE);
    int expectedSize = 2;
    List<TestClass> actualList = jsonUtils.toObjectList(JSON_LIST_STRING, TestClass.class);
    assertEquals(actualList.size(), expectedSize);
}
 
Example 2
Source File: JsonUtilsTests.java    From vividus with Apache License 2.0 5 votes vote down vote up
@Test
void testToObjectListInputStreamSuccess()
{
    InputStream jsonListStream = new ByteArrayInputStream(JSON_LIST_STRING.getBytes(StandardCharsets.UTF_8));
    jsonUtils = new JsonUtils(PropertyNamingStrategy.SNAKE_CASE);
    int expectedSize = 2;
    List<TestClass> actualList = jsonUtils.toObjectList(jsonListStream, TestClass.class);
    assertEquals(actualList.size(), expectedSize);
}
 
Example 3
Source File: MattermostPropertyNamingStrategy.java    From mattermost4j with Apache License 2.0 5 votes vote down vote up
protected PropertyNamingStrategy judgeStrategy(AnnotatedMember member) {
  Class<?> clazz = member.getDeclaringClass();
  if (Config.class.isAssignableFrom(clazz)) {
    return PropertyNamingStrategy.UPPER_CAMEL_CASE;
  } else if (clazz.getCanonicalName().startsWith("net.bis5.mattermost.model.config.")) {
    return PropertyNamingStrategy.UPPER_CAMEL_CASE;
  } else {
    return PropertyNamingStrategy.SNAKE_CASE;
  }
}