package cn.ibizlab.codegen.templating;


public enum TemplateFileType {
    ctrl(Constants.CTRLS),
    page(Constants.PAGES),
    appEntity(Constants.APP_ENTITIES),
    apiEntity(Constants.API_ENTITIES),
    apiDto(Constants.API_DTOS),
    entity(Constants.ENTITIES),
    module(Constants.MODULES),
    workflow(Constants.WORKFLOWS),
    sysUtil(Constants.SYSUTILS),
    subService(Constants.SUB_SERVICEAPIS),
    subEntity(Constants.SUB_ENTITIES),
    api(Constants.APIS),
    app(Constants.APPS),
    supportingFiles(Constants.SUPPORTING_FILES);

    private final String templateType;

    TemplateFileType(String templateType) {
        this.templateType = templateType;
    }

    /**
     * Returns the value for this template file type
     *
     * @return The template type of this enum.
     */
    public String value() {
        return this.templateType;
    }


    /**
     * Obtains the {@link TemplateFileType} for an input string.
     *
     * @param templateType a {@link String} object.
     * @return a {@link TemplateFileType} object.
     */
    public static TemplateFileType forTemplateType(String templateType) {
        for (TemplateFileType value : values()) {
            if (value.templateType.equalsIgnoreCase(templateType)||value.name().equalsIgnoreCase(templateType)) {
                return value;
            }
        }
        return null;
    }

    public static class Constants {
        public static final String APIS = "apis";
        public static final String APPS = "apps";
        public static final String ENTITIES = "entities";
        public static final String WORKFLOWS = "workflows";
        public static final String SYSUTILS = "syUtils";
        public static final String SUB_SERVICEAPIS = "subServiceApis";
        public static final String SUB_ENTITIES = "subEntities";
        public static final String API_ENTITIES = "apiEntities";
        public static final String API_DTOS = "apiDtos";
        public static final String APP_ENTITIES = "appEntities";
        public static final String MODULES = "modules";
        public static final String PAGES = "pages";
        public static final String CTRLS = "ctrls";
        public static final String SUPPORTING_FILES = "supportingFiles";
    }
}
