All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.arextest.storage.utils.JsonUtil Maven / Gradle / Ivy

There is a newer version: 2.0.2
Show newest version
package com.arextest.storage.utils;

import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.apache.commons.lang3.StringUtils;

public class JsonUtil {

  public static boolean isJsonStr(String obj) {
    return StringUtils.isNotEmpty(obj) &&
        ((obj.startsWith("{") && obj.endsWith("}")) || (obj.startsWith("[") && obj.endsWith("]")));
  }

  public static final ObjectMapper OBJECT_MAPPER = new ObjectMapper()
      .configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy