Deserialize a single {@link org.nnsoft.sameas4j.Equivalence}
from its Json serialization.

@param json object to be deserialized
@return a not null {@link org.nnsoft.sameas4j.Equivalence} instance
480999
public Equivalence getEquivalence(JsonElement json) {
        Equivalence equivalence;
        String uriString = json.getAsJsonObject().getAsJsonPrimitive(URI).getAsString();
        URI uri;
        try {
            uri = new URI(urlEncode(uriString));
        } catch (Exception e) {
            throw new JsonParseException(String.format(EXCEPTION_MESSAGE, uriString));
        }
        equivalence = new Equivalence(uri);
        JsonArray duplicates = json.getAsJsonObject().getAsJsonArray(DUPLICATES);
        for (int i = 0; i < duplicates.size(); i++) {
            try {
                equivalence.addDuplicate(new URI(urlEncode(duplicates.get(i).getAsString())));
            } catch (Exception e) {
                // if an equivalent URI is not well-formed it's better to do not add it, let's go on
                continue;
            }
        }
        return equivalence;
    }
979036
@Override
    public ScriptModuleSpec deserialize(String json) {
        Objects.requireNonNull(json, "json");
        ScriptModuleSpec moduleSpec = SERIALIZER.fromJson(json, ScriptModuleSpec.class);
        return moduleSpec;

    }
150705
public JSONObject getJSONObject(String key) throws JSONException {
    Object o = get(key);
    if (o instanceof JSONObject) {
      return (JSONObject) o;
    }
    throw new JSONException("JSONObject[" + quote(key) + "] is not a JSONObject.");
  }
1314612
@NonNull
  public static CarmenFeature fromJson(@NonNull String json) {

    Gson gson = new GsonBuilder()
      .registerTypeAdapterFactory(GeometryAdapterFactory.create())
      .registerTypeAdapter(BoundingBox.class, new BoundingBoxTypeAdapter())
      .registerTypeAdapterFactory(GeocodingAdapterFactory.create())
      .create();
    CarmenFeature feature = gson.fromJson(json, CarmenFeature.class);
    // Even thought properties are Nullable,
    // Feature object will be created with properties set to an empty object,
    return feature.properties() == null
      ? feature.toBuilder().properties(new JsonObject()).build()
      : feature;
  }
114130
public static Object getStringFromJSONObject(final String json, final String key) {
        requireNonNull(json, "json is null");
        return JSON.parseObject(json).getString(key);
    }
1297635
public static JWEHeader deserialize(String json) throws IOException {
        ObjectMapper mapper = new ObjectMapper();
        return mapper.readValue(json, JWEHeader.class);
    }
881700
public static BaseBo fromJson(String json, ClassLoader classLoader) {
        return fromJson(json, BaseBo.class, classLoader);
    }
1329490
public static DataAnalysis fromJson(String json) {
        try{
            return new JsonSerializer().getObjectMapper().readValue(json, DataAnalysis.class);
        } catch (Exception e){
            //Legacy format
            ObjectMapper om = new JsonSerializer().getObjectMapper();
            return fromMapper(om, json);
        }
    }
606350
public static JSONObject fromJSON(String json) {
    int index1 = json.lastIndexOf("\"_i\":\"");
    if (index1 < 0)
      throw new JsonParseException("Unable to find _i key.");
    index1 += 6;
    int index2 = json.indexOf("\"", index1 + 1);
    if (index2 < 0)
      throw new JsonParseException("Unable to find end of _i value.");
    String id = json.substring(index1, index2);
    Class<? extends JSONObject> clazz = registrations.get(id);
    if (clazz == null){
      // See if the id is a full classname
      try{
        clazz = (Class<? extends JSONObject>) Class.forName(id);
        registrations.put(id, clazz);
      }catch(ClassNotFoundException ex){
        throw new JsonParseException("No registration for JSONObject message.identifier:" + id);
      }
    }
    return fromJSON(json, clazz);
  }
793802
public static ReadContext fromJson(String json) {
        Objects.requireNonNull(json, Required.JSON.toString());
        
        return JsonPath.parse(json);
    }
641165
public static Props fromJSONString(final String json) throws IOException {
    final Map<String, String> obj = (Map<String, String>) JSONUtils.parseJSONFromString(json);
    final Props props = new Props(null, obj);
    return props;
  }
693063
public JSONObject asJSONObject()
    {
        if ( entity == null ) {
            return null;
        }
        String str = asString();
        try {
            return new JSONObject( str );
        } catch ( JSONException ex ) {
            throw new CStorageException( "Error parsing the JSON response: " + str, ex );
        }
    }
348204
public static <O> O deserialise(String json, Class<O> type) {
        Gson gson = getBuilder().create();
        return gson.fromJson(json, type);
    }
468436
@Override
    public BoundingBox deserialize(final JsonElement json, final Type typeOfT,
            final JsonDeserializationContext context) {

        final BoundingBox bbox;

        if (json.isJsonArray()) {
            final JsonArray bboxJsonArray = json.getAsJsonArray();
            bbox = new BoundingBox();
            bbox.setSouth(bboxJsonArray.get(0).getAsDouble());
            bbox.setNorth(bboxJsonArray.get(1).getAsDouble());
            bbox.setWest(bboxJsonArray.get(2).getAsDouble());
            bbox.setEast(bboxJsonArray.get(3).getAsDouble());
        } else {
            throw new JsonParseException("Unexpected data: " + json.toString());
        }

        return bbox;
    }
842768
protected Object jsonDeserialize(byte[] in, Class<?> cls) {
        if (in == null || in.length == 0) {
            return null;
        }
        Object res = null;
        try {
            res = JsonUtils.json2Object(new String(in, "utf-8"), cls);
        } catch (UnsupportedEncodingException e) {
            logger.error("DeSerialize object fail ", e);
        }
        return res;
    }
610066
private static Optional<ICondition> asEquals( JsonObject json)
    {
    return
      Optional.of( json)
      .filter( j -> j.containsKey( EQUALS_KEY))
      .map( j -> j.getJsonObject( EQUALS_KEY))
      .map( e -> new Equals( e.getString( PROPERTY_KEY), e.getInt( COUNT_KEY)));
    }
588255
public static TransformProcess fromJson(String json) {
        try {
            return JsonMappers.getMapper().readValue(json, TransformProcess.class);
        } catch (IOException e) {
            //TODO proper exception message
            throw new RuntimeException(e);
        }
    }