diff --git a/presto-main/src/main/java/com/facebook/presto/sql/planner/plan/PlanFragmentId.java b/presto-main/src/main/java/com/facebook/presto/sql/planner/plan/PlanFragmentId.java
index <HASH>..<HASH> 100644
--- a/presto-main/src/main/java/com/facebook/presto/sql/planner/plan/PlanFragmentId.java
+++ b/presto-main/src/main/java/com/facebook/presto/sql/planner/plan/PlanFragmentId.java
@@ -18,30 +18,37 @@ import com.fasterxml.jackson.annotation.JsonValue;
 
 import javax.annotation.concurrent.Immutable;
 
+import static java.util.Objects.requireNonNull;
+
 @Immutable
 public class PlanFragmentId
         implements Comparable<PlanFragmentId>
 {
     private final int id;
 
-    @JsonCreator
     public PlanFragmentId(int id)
     {
         this.id = id;
     }
 
-    @JsonValue
     public int getId()
     {
         return id;
     }
 
     @Override
+    @JsonValue
     public String toString()
     {
         return Integer.toString(id);
     }
 
+    @JsonCreator
+    public static PlanFragmentId valueOf(String value)
+    {
+        return new PlanFragmentId(Integer.valueOf(requireNonNull(value, "value is null")));
+    }
+
     @Override
     public boolean equals(Object o)
     {
Encode PlanFragmentId as string in JSON

The "Create stage id based on the plan fragment id" commit changed the
way the PlanFragmentId is encoded in JSON:

<URL>:

<URL>
are encoded as a string, it seems to be more convenient to also have
the PlanFragmentId encoded as a string.