If you can convert your json to a Map, you can remap the whole map (recursively) transforming every key to its lowercase value.
Something like :
public static Map<String,Object> convertToLowerCaseKeys(Map<String,Object> map){
return map.entrySet().stream().collect(Collectors.toMap(e -> e.getKey().toLowerCase(), e -> {
if(e.getValue() != null && e.getValue() instanceof Map){
return convertToLowerCaseKeys((Map<String,Object>)e.getValue());
}
return e.getValue();
}));
}
Note that the cast to Map might be a little too hasty but I've gone with it for simplicity.
EDIT :
To search for a (top-level) key while being case insensitive :
public static Object getCaseInsensitive(Map<String,Object> map, String key){
if(key == null){
return map.get(null);
}
Optional<String> optional = map.keySet().stream().filter(e -> e != null && e.toLowerCase().equals(key.toLowerCase())).findAny();
if(optional.isPresent()){
return map.get(optional.get());
}
return null;
}