public static Optional<TrackInfo> importFromResource(ResourceModel resourceModel) {
        Object resource = resourceModel.getResource();
        try {
            @SuppressWarnings("unchecked")
            HashMap<String, Object> hashMap = (HashMap<String, Object>) resource;
            return importFromHashMap(hashMap);
        } catch (ClassCastException e) {
            return Optional.empty();
        }
    }
public static Optional<TrackInfo> importFromResource(ResourceModel resourceModel) {
        Object resource = resourceModel.getResource();
        try {
            @SuppressWarnings("unchecked")
            HashMap<String, Object> hashMap = (HashMap<String, Object>) resource;
            return importFromHashMap(hashMap);
        } catch (ClassCastException e) {
            return Optional.empty();
        }
    }
public static Optional < TrackInfo > importFromResource ( ResourceModel resourceModel ) { Object resource = resourceModel . getResource ( ) ; try { @ SuppressWarnings ( "unchecked" ) HashMap < String , Object > hashMap = ( HashMap < String , Object > ) resource ; return importFromHashMap ( hashMap ) ; } catch ( ClassCastException e ) { return Optional . empty ( ) ; } }
creates a TrackInfo from the resourceModel
@param resourceModel the resourceModel
@return the optional TrackInfo
creates a TrackInfo from the resourceModel