From a8e0aab611030df7c75c9394df7d7b3c1d6c13f8 Mon Sep 17 00:00:00 2001 From: Aman Gupta Date: Tue, 12 Mar 2024 14:12:43 -0400 Subject: [PATCH] add deserialize method for Urn java classes (#370) --- .../src/main/javaPegasus/com/linkedin/testing/urn/BarUrn.java | 4 ++++ .../src/main/javaPegasus/com/linkedin/testing/urn/BazUrn.java | 4 ++++ .../main/javaPegasus/com/linkedin/testing/urn/BurgerUrn.java | 4 ++++ .../src/main/javaPegasus/com/linkedin/testing/urn/FooUrn.java | 4 ++++ .../main/javaPegasus/com/linkedin/testing/urn/PizzaUrn.java | 4 ++++ .../com/linkedin/testing/urn/SingleAspectEntityUrn.java | 4 ++++ 6 files changed, 24 insertions(+) diff --git a/testing/test-models/src/main/javaPegasus/com/linkedin/testing/urn/BarUrn.java b/testing/test-models/src/main/javaPegasus/com/linkedin/testing/urn/BarUrn.java index aa8a2882d..7be996aaf 100644 --- a/testing/test-models/src/main/javaPegasus/com/linkedin/testing/urn/BarUrn.java +++ b/testing/test-models/src/main/javaPegasus/com/linkedin/testing/urn/BarUrn.java @@ -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); + } } diff --git a/testing/test-models/src/main/javaPegasus/com/linkedin/testing/urn/BazUrn.java b/testing/test-models/src/main/javaPegasus/com/linkedin/testing/urn/BazUrn.java index 0e296139a..0ed23fa29 100644 --- a/testing/test-models/src/main/javaPegasus/com/linkedin/testing/urn/BazUrn.java +++ b/testing/test-models/src/main/javaPegasus/com/linkedin/testing/urn/BazUrn.java @@ -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); + } } diff --git a/testing/test-models/src/main/javaPegasus/com/linkedin/testing/urn/BurgerUrn.java b/testing/test-models/src/main/javaPegasus/com/linkedin/testing/urn/BurgerUrn.java index f99b981bb..3d8fe1158 100644 --- a/testing/test-models/src/main/javaPegasus/com/linkedin/testing/urn/BurgerUrn.java +++ b/testing/test-models/src/main/javaPegasus/com/linkedin/testing/urn/BurgerUrn.java @@ -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); + } } diff --git a/testing/test-models/src/main/javaPegasus/com/linkedin/testing/urn/FooUrn.java b/testing/test-models/src/main/javaPegasus/com/linkedin/testing/urn/FooUrn.java index 118c5317f..6b3ccb249 100644 --- a/testing/test-models/src/main/javaPegasus/com/linkedin/testing/urn/FooUrn.java +++ b/testing/test-models/src/main/javaPegasus/com/linkedin/testing/urn/FooUrn.java @@ -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); + } } diff --git a/testing/test-models/src/main/javaPegasus/com/linkedin/testing/urn/PizzaUrn.java b/testing/test-models/src/main/javaPegasus/com/linkedin/testing/urn/PizzaUrn.java index 4815c3189..4aaa52fc0 100644 --- a/testing/test-models/src/main/javaPegasus/com/linkedin/testing/urn/PizzaUrn.java +++ b/testing/test-models/src/main/javaPegasus/com/linkedin/testing/urn/PizzaUrn.java @@ -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); + } } diff --git a/testing/test-models/src/main/javaPegasus/com/linkedin/testing/urn/SingleAspectEntityUrn.java b/testing/test-models/src/main/javaPegasus/com/linkedin/testing/urn/SingleAspectEntityUrn.java index 48cbc8b33..20e678ed7 100644 --- a/testing/test-models/src/main/javaPegasus/com/linkedin/testing/urn/SingleAspectEntityUrn.java +++ b/testing/test-models/src/main/javaPegasus/com/linkedin/testing/urn/SingleAspectEntityUrn.java @@ -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); + } }