From 92ad87c6bcbc317fb7988b7fcb90b272f3afc363 Mon Sep 17 00:00:00 2001 From: Xavi Aracil Date: Wed, 30 Nov 2022 18:48:56 +0100 Subject: [PATCH] Several ways to get the id --- .../inspect/vc/jsonld/probe/JsonLDCompactionProve.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/inspector-vc/src/main/java/org/oneedtech/inspect/vc/jsonld/probe/JsonLDCompactionProve.java b/inspector-vc/src/main/java/org/oneedtech/inspect/vc/jsonld/probe/JsonLDCompactionProve.java index 9a7bc6f..40a90d8 100644 --- a/inspector-vc/src/main/java/org/oneedtech/inspect/vc/jsonld/probe/JsonLDCompactionProve.java +++ b/inspector-vc/src/main/java/org/oneedtech/inspect/vc/jsonld/probe/JsonLDCompactionProve.java @@ -6,6 +6,7 @@ import org.oneedtech.inspect.core.probe.Probe; import org.oneedtech.inspect.core.probe.RunContext; import org.oneedtech.inspect.core.probe.RunContext.Key; import org.oneedtech.inspect.core.report.ReportItems; +import org.oneedtech.inspect.util.resource.Resource; import org.oneedtech.inspect.vc.Credential; import org.oneedtech.inspect.vc.jsonld.JsonLdGeneratedObject; @@ -51,7 +52,14 @@ public class JsonLDCompactionProve extends Probe { } public static String getId(Credential crd) { - return "json-ld-compact:" + crd.getResource().getID(); + return getId(crd.getResource()); + } + + public static String getId(Resource resource) { + return getId(resource.getID()); + } + public static String getId(String id) { + return "json-ld-compact:" + id; } public static final String ID = JsonLDCompactionProve.class.getSimpleName();