Several ways to get the id

This commit is contained in:
Xavi Aracil 2022-11-30 18:48:56 +01:00
parent dc0f501772
commit 92ad87c6bc

View File

@ -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<Credential> {
}
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();