Resolved conflicts

This commit is contained in:
rajesh
2025-03-24 19:21:50 +05:30
6 changed files with 181 additions and 72 deletions

View File

@@ -886,4 +886,22 @@ public class Utils {
}
/**
* Extracts a Map from a parent Map safely.
*/
public static Map<String, Object> extractMap(Map<String, Object> parentMap, String key) {
Object obj = parentMap.get(key);
if (obj instanceof Map<?, ?> map) {
return (Map<String, Object>) map;
}
return null;
}
/**
* Extracts a String from a Map safely.
*/
public static String extractString(Map<String, Object> parentMap, String key) {
Object obj = parentMap.get(key);
return (obj instanceof String str) ? str : null;
}
}