@Nonnull
	public static WorkspacePatch deserialize(@Nonnull Workspace workspace, @Nonnull String patchContents) throws PatchGenerationException {
		List<RemovePath> removals = Collections.emptyList();
		List<JvmAssemblerPatch> jvmAssemblerPatches = Collections.emptyList();
		List<TextFilePatch> textFilePatches = Collections.emptyList();
		if (patchContents.isBlank() || patchContents.charAt(0) != '{' || patchContents.charAt(patchContents.length() - 1) != '}')
			return new WorkspacePatch(workspace, removals, jvmAssemblerPatches, textFilePatches);
		try {
			JsonReader jr = GSON.newJsonReader(new StringReader(patchContents));
			jr.beginObject();
			while (jr.hasNext()) {
				String name = jr.nextName();
				switch (name) {
					case KEY_CLASS_JVM_ASM_DIFFS -> jvmAssemblerPatches = deserializeClassJvmAsmDiffs(workspace, jr);
					case KEY_FILE_TEXT_DIFFS -> textFilePatches = deserializeFileTextDiffs(workspace, jr);
					case KEY_REMOVALS -> removals = deserializeRemovals(workspace, jr);
				}
			}
			jr.endObject();
			return new WorkspacePatch(workspace, removals, jvmAssemblerPatches, textFilePatches);
		} catch (Exception ex) {
			throw new PatchGenerationException(ex, "Failed to parse patch contents");
		}
	}
Maps a JSON file into a workspace patch.

@param workspace
		Workspace to apply the patch to.
@param patchContents
		JSON outlining patch contents.

@return A workspace patch instance.

@throws PatchGenerationException
		When the JSON file couldn't be parsed, or its contents could not be found in the workspace.
recaf-core/src/main/java/software/coley/recaf/services/workspace/patch/PatchSerialization.java