Deserialises the given json String.

@param json The Json to deserialise.
@param type The type to deserialise into.
@param <O>  The type to deserialise to.
@return A new instance of the given type.
348204
public static <O> O deserialise(String json, Class<O> type) {
        Gson gson = getBuilder().create();
        return gson.fromJson(json, type);
    }
928944
public <C> C mapTo(JavaType type) {
    JacksonJsonDataFormatMapper mapper = dataFormat.getMapper();
    return mapper.mapInternalToJava(jsonNode, type);
  }
496077
public void fromJson(JSONObject json) {
        super.fromJson(json);
        if (json.containsKey(CHANGE)) {
            change = new Change(json.getJSONObject(CHANGE));
        }
        if (json.containsKey(PATCH_SET)) {
            patchSet = new PatchSet(json.getJSONObject(PATCH_SET));
        } else if (json.containsKey(PATCHSET)) {
            patchSet = new PatchSet(json.getJSONObject(PATCHSET));
        }
    }
1116049
public static <T> T fromJSON(String json, Class<T> classOfT) {
    return gson.fromJson(json, classOfT);
  }
1150805
public <C> C mapTo(Class<C> type) {
    DataFormatMapper mapper = dataFormat.getMapper();
    return mapper.mapInternalToJava(jsonNode, type);
  }
1136040
@SuppressWarnings("unchecked")
    @Override
    public final <T> T deserialize(byte[] content, Type type) throws SerializerException {
        if (byte[].class.equals(type)) {
            return (T) content;
        }
        throw new SerializerException("Unable to deserialize to type '" + type + "'");
    }
886711
public static Properties parseJSON(String json) {
    try {
      return utilsImpl.parseJSON(json);
    } catch (Exception e) {
      if (!GWT.isProdMode()) {
        System.err.println("Error while parsing json: " + e.getMessage() + ".\n" + json);
      }
      return Properties.create();
    }
  }
110962
@SuppressWarnings("unused")
  public static CarmenContext fromJson(@NonNull String json) {
    Gson gson = new GsonBuilder()
      .registerTypeAdapterFactory(GeocodingAdapterFactory.create())
      .create();
    return gson.fromJson(json, CarmenContext.class);
  }
840025
@Override
    public PolygonPoint[] deserialize(final JsonElement json, final Type typeOfT,
            final JsonDeserializationContext context) {

        final PolygonPoint[] points;

        if (json.isJsonArray()) {

            final JsonArray pointsJsonArray = json.getAsJsonArray();
            points = new PolygonPoint[pointsJsonArray.size()];

            for (int i = 0; i < pointsJsonArray.size(); i++) {
                points[i] = context.deserialize(pointsJsonArray.get(i), PolygonPoint.class);
            }
        } else {
            throw new JsonParseException("Unexpected data: " + json.toString());
        }

        return points;
    }
573425
public static <T> T fromJson(JsonNode json, Class<T> clazz, ClassLoader classLoader) {
        return SerializationUtils.fromJson(json, clazz, classLoader);
    }
105019
public static final AuthToken fromJSON(String json) {
        try {
            return mapper.reader(AuthToken.class).readValue(json);
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
    }
996555
@SuppressWarnings("unchecked")
    public <T> T decode(Type type, JsonNode jsonNode) throws Exception {
        return (T) (mapper.fromJson(jsonNode, type));
    }
669495
@Override
    public T deserialize(String messageJson) {
        VersionedMessage<T> versionedMessage = gson.fromJson(messageJson, versionedMessageType);

        // older style messages not wrapped with VersionedMessage
        if (versionedMessage.getVersion() == null) {
            Type t = ((ParameterizedType) versionedMessageType).getActualTypeArguments()[0];
            versionedMessage = new VersionedMessage<>(MessageVersion.NO_VERSION, gson.<T>fromJson(messageJson, t));
        }
        checkVersion(versionedMessage, messageJson);

        return versionedMessage.getMessage();
    }
644344
public Object deserialize(JsonObject message) {
    String type = message.getString("type");
    if (type == null) {
      return message.getValue("value");
    } else {
      switch (type) {
        case "buffer":
          return new Buffer(message.getBinary("value"));
        case "bytes":
          return message.getBinary("value");
        case "serialized":
          byte[] bytes = message.getBinary("value");
          ObjectInputStream stream = null;
          try {
            stream = new ThreadObjectInputStream(new ByteArrayInputStream(bytes));
            return stream.readObject();
          } catch (ClassNotFoundException | IOException e) {
            throw new SerializationException(e.getMessage());
          } finally {
            if (stream != null) {
              try {
                stream.close();
              } catch (IOException e) {
              }
            }
          }
        default:
          return message.getValue("value");
      }
    }
  }
351213
public static CreateUpdateEntitiesResult fromJson(String json) throws AtlasServiceException {

        GuidMapping guidMapping = AtlasType.fromJson(json, GuidMapping.class);
        EntityResult entityResult = EntityResult.fromString(json);
        CreateUpdateEntitiesResult result = new CreateUpdateEntitiesResult();
        result.setEntityResult(entityResult);
        result.setGuidMapping(guidMapping);
        return result;
    }
46832
@Nullable
    public static <T> T getJson(@NonNull SharedPreferences prefs,
            @NonNull String key, @NonNull Type type) {
        return GsonHelper.fromJson(prefs.getString(key, null), type);
    }
828189
public void fromJson(String json) throws IOException, ParseException {
        JsonUtils.fromJson(this, json);
        this.json = json;
    }