Skip to content

Commit

Permalink
add deserialize method for Urn java classes (#370)
Browse files Browse the repository at this point in the history
  • Loading branch information
aman1309 authored Mar 12, 2024
1 parent 56e4fe1 commit a8e0aab
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,8 @@ public static BarUrn createFromString(String rawUrn) throws URISyntaxException {

return new BarUrn(urn.getIdAsInt());
}

public static BarUrn deserialize(String serializedUrn) throws URISyntaxException {
return createFromString(serializedUrn);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,8 @@ public static BazUrn createFromString(String rawUrn) throws URISyntaxException {

return new BazUrn(urn.getIdAsInt());
}

public static BazUrn deserialize(String serializedUrn) throws URISyntaxException {
return createFromString(serializedUrn);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,8 @@ public static BurgerUrn createFromString(String rawUrn) throws URISyntaxExceptio

return new BurgerUrn(urn.getId());
}

public static BurgerUrn deserialize(String serializedUrn) throws URISyntaxException {
return createFromString(serializedUrn);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,8 @@ public static FooUrn createFromString(String rawUrn) throws URISyntaxException {

return new FooUrn(urn.getIdAsInt());
}

public static FooUrn deserialize(String serializedUrn) throws URISyntaxException {
return createFromString(serializedUrn);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,8 @@ public static PizzaUrn createFromString(String rawUrn) throws URISyntaxException

return new PizzaUrn(urn.getIdAsInt());
}

public static PizzaUrn deserialize(String serializedUrn) throws URISyntaxException {
return createFromString(serializedUrn);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,8 @@ public SingleAspectEntityUrn(long id) throws URISyntaxException {
public static SingleAspectEntityUrn createFromString(String rawUrn) throws URISyntaxException {
return new SingleAspectEntityUrn(Urn.createFromString(rawUrn).getIdAsInt());
}

public static SingleAspectEntityUrn deserialize(String serializedUrn) throws URISyntaxException {
return createFromString(serializedUrn);
}
}

0 comments on commit a8e0aab

Please sign in to comment.