From 119408d7829e3819428f4119c3b1005fdece9880 Mon Sep 17 00:00:00 2001 From: Robert von Burg Date: Wed, 19 Feb 2020 22:22:51 +0100 Subject: [PATCH] [New] Added PolicyDef.valueOf(Class, String) override --- .../java/li/strolch/model/policy/PolicyDef.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/li.strolch.model/src/main/java/li/strolch/model/policy/PolicyDef.java b/li.strolch.model/src/main/java/li/strolch/model/policy/PolicyDef.java index dda551e11..20b7cc724 100644 --- a/li.strolch.model/src/main/java/li/strolch/model/policy/PolicyDef.java +++ b/li.strolch.model/src/main/java/li/strolch/model/policy/PolicyDef.java @@ -106,6 +106,20 @@ public abstract class PolicyDef { return sb.toString(); } + /** + * Returns a {@link PolicyDef} instance which handles the given type of XML Value + * + * @param type + * the type, using the {@link Class#getSimpleName()} to delegate to {@link #valueOf(String, String)} + * @param xmlValue + * the XML formatted value with the prefix denoting the {@link PolicyDef} type + * + * @return a {@link PolicyDef} instance which handles the given type of XML Value + */ + public static PolicyDef valueOf(Class type, String xmlValue) { + return valueOf(type.getSimpleName(), xmlValue); + } + /** * Returns a {@link PolicyDef} instance which handles the given type of XML Value *