Util classes should have private constructors

This commit is contained in:
Xuan-Zhang Gong
2024-11-18 14:11:20 +08:00
parent 0bc4148a34
commit 6e4155a146

View File

@@ -82,6 +82,10 @@ public class JacksonUtil {
}
}
private JacksonUtil() {
throw new IllegalStateException("Utility class JacksonUtil can not be instantiated");
}
public static ObjectMapper initMapper() {
JsonMapper.Builder builder = JsonMapper.builder()
.enable(JSON_READ_FEATURES_ENABLED.toArray(new JsonReadFeature[0]));