com.duoec.doc.utils.BookUtils Maven / Gradle / Ivy
package com.duoec.doc.utils;
import com.duoec.doc.doclet.pojo.Api;
import com.duoec.doc.doclet.pojo.Chapter;
import com.duoec.doc.doclet.pojo.Section;
import com.duoec.doc.dto.state.DocParseState;
import java.util.Collections;
import java.util.List;
/**
* @author xuwenzhen
*/
public class BookUtils {
private BookUtils() {}
public static void sort() {
List chapterList = DocParseState.getBook().getChapters();
if (!CollectionUtils.isEmpty(chapterList)) {
Collections.sort(chapterList);
}
for (Chapter chapter : chapterList) {
sortSections(chapter.getSections());
}
}
private static void sortSections(List sections) {
if (!CollectionUtils.isEmpty(sections)) {
Collections.sort(sections);
}
for (Section section : sections) {
List apis = section.getApis();
if (!CollectionUtils.isEmpty(apis)) {
Collections.sort(apis);
}
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy