The main difference is that adaptTo can return null, so you will have to make sure to implement some null check while using it, to avoid NPE.
getValueMap() method is null safe and will return empty ValueMap in worst case.
In terms of getting ValueMap, you can also check ResourceUtil.getValueMap(resource) that will return empty ValueMap even in the scenario when give resource is null.
The main difference is that adaptTo can return null, so you will have to make sure to implement some null check while using it, to avoid NPE.
getValueMap() method is null safe and will return empty ValueMap in worst case.
In terms of getting ValueMap, you can also check ResourceUtil.getValueMap(resource) that will return empty ValueMap even in the scenario when give resource is null.