@Test public void testMapperAcceptsCaseInsensitiveEnums() throws IOException { ObjectMapper mapper = BatfishObjectMapper.mapper(); assertThat(mapper.writeValueAsString(SomeEnum.ACCEPT), equalTo("\"ACCEPT\"")); assertThat(mapper.writeValueAsString(SomeEnum.DROP), equalTo("\"DROP\"")); assertThat(mapper.readValue("\"ACCEPT\"", SomeEnum.class), equalTo(SomeEnum.ACCEPT)); assertThat(mapper.readValue("\"accept\"", SomeEnum.class), equalTo(SomeEnum.ACCEPT)); assertThat(mapper.readValue("\"aCcEpT\"", SomeEnum.class), equalTo(SomeEnum.ACCEPT)); assertThat(mapper.readValue("\"DROP\"", SomeEnum.class), equalTo(SomeEnum.DROP)); assertThat(mapper.readValue("\"drop\"", SomeEnum.class), equalTo(SomeEnum.DROP)); assertThat(mapper.readValue("\"DRop\"", SomeEnum.class), equalTo(SomeEnum.DROP)); }
public static ObjectMapper mapper() { return MAPPER; }
BatfishObjectMapper { public static ObjectMapper mapper() { return MAPPER; } }
BatfishObjectMapper { public static ObjectMapper mapper() { return MAPPER; }  }
BatfishObjectMapper { public static ObjectMapper mapper() { return MAPPER; }  static ObjectMapper mapper(); @VisibleForTesting // used in JSON serde tests. static T clone(Object o, Class<T> clazz); @VisibleForTesting // used in JSON serde tests. static T clone(Object o, TypeReference<T> type); static ObjectWriter writer(); static ObjectWriter prettyWriter(); static ObjectMapper verboseMapper(); static ObjectWriter verboseWriter(); static String writeStringWithNulls(Object o); static String writeString(Object o); static String writePrettyString(Object o); static String writeStringRuntimeError(Object o); static String writePrettyStringRuntimeError(Object o); }
BatfishObjectMapper { public static ObjectMapper mapper() { return MAPPER; }  static ObjectMapper mapper(); @VisibleForTesting // used in JSON serde tests. static T clone(Object o, Class<T> clazz); @VisibleForTesting // used in JSON serde tests. static T clone(Object o, TypeReference<T> type); static ObjectWriter writer(); static ObjectWriter prettyWriter(); static ObjectMapper verboseMapper(); static ObjectWriter verboseWriter(); static String writeStringWithNulls(Object o); static String writeString(Object o); static String writePrettyString(Object o); static String writeStringRuntimeError(Object o); static String writePrettyStringRuntimeError(Object o);  }