
com.adobe.aemds.guide.utils.GuideProgressiveUtils Maven / Gradle / Ivy
package com.adobe.aemds.guide.utils;
import com.adobe.aemds.guide.progressive.GuideProgressiveCompletionInfo;
import com.adobe.aemds.guide.progressive.GuideProgressiveSectionInfo;
import com.adobe.aemds.guide.service.GuideException;
import org.apache.sling.commons.json.JSONException;
import org.apache.sling.commons.json.io.JSONWriter;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.io.StringWriter;
import java.util.List;
/**
* @pad.exclude Exclude from Published API.
*/
public class GuideProgressiveUtils {
private static Logger logger = LoggerFactory.getLogger(GuideProgressiveUtils.class);
private static String getSectionJson(Object section){
if(section instanceof GuideProgressiveSectionInfo){
return ((GuideProgressiveSectionInfo)section).convertToJSON();
} else if(section instanceof GuideProgressiveCompletionInfo){
return ((GuideProgressiveCompletionInfo)section).convertToJSON();
} else {
return null;
}
}
/**
* Utility to convert the given section list into JSON
* @param allSections
*/
public static String convertToJson(List
© 2015 - 2025 Weber Informatics LLC | Privacy Policy