I think there are 2 ways retrieve data from Content Fragment.
ContentFragment cf = resourceResolver.resolve(cfPath).adaptTo(ContentFragment.class);
cf.getElement("summary").getContent(); // way1
cf.getElement("summary").getValue().getValue(String.class); // way2
When I need to get String value, are there any difference between way1 and way2? Which is better way?
Additional question:
When I need to get multiple values, is this only way to retrieve data from CF?
String[] array = cf.getElement("imagePaths").getValue().getValue(String[].class);