Hi, We have a code snippet,
Map<String, Object> assetMeta = damAsset.getMetadata();
boolean isActiveAsset;
boolean hasOnTime = (assetMeta.get("idam:offTime") != null);
boolean hasOffTime = (assetMeta.get("idam:onTime") != null);
Date offTimeDate = hasOnTime ? ((XMPDateTime) assetMeta.get("idam:offTime")).getCalendar().getTime() : null;
Date onTimeDate = hasOffTime ? ((XMPDateTime) assetMeta.get("idam:onTime")).getCalendar().getTime() : null;
Basically it is getting on and off time of an asset. But the casting in line 5 and 6 is providing class cast exception. Please suggest a way to get rid of the same?
Solved! Go to Solution.
Views
Replies
Total Likes
hi @akhilraj ,
Check some of the examples of similar case here - https://www.tabnine.com/code/java/methods/com.day.cq.dam.api.Asset/getLastModified
hi @akhilraj ,
Check some of the examples of similar case here - https://www.tabnine.com/code/java/methods/com.day.cq.dam.api.Asset/getLastModified