package cn.axzo.workflow.generate;

import com.squareup.javapoet.TypeSpec;

public class GenCodeInfo {
    private final TypeSpec typeSpec;
    private final String sourcePath;
    private final String packageName;
    private final String className;

    public static GenCodeInfoBuilder builder() {
        return new GenCodeInfoBuilder();
    }

    public TypeSpec getTypeSpec() {
        return typeSpec;
    }

    public String getSourcePath() {
        return sourcePath;
    }

    public String getPackageName() {
        return packageName;
    }

    public String getClassName() {
        return className;
    }

    private GenCodeInfo(GenCodeInfoBuilder builder) {
        this.typeSpec = builder.typeSpec;
        this.sourcePath = builder.sourcePath;
        this.packageName = builder.packageName;
        this.className = builder.className;
    }

    public static class GenCodeInfoBuilder {
        private TypeSpec typeSpec;
        private String sourcePath;
        private String packageName;
        private String className;

        public GenCodeInfoBuilder typeSpec(TypeSpec typeSpec) {
            this.typeSpec = typeSpec;
            return this;
        }

        public GenCodeInfoBuilder sourcePath(String sourcePath) {
            this.sourcePath = sourcePath;
            return this;
        }

        public GenCodeInfoBuilder packageName(String packageName) {
            this.packageName = packageName;
            return this;
        }

        public GenCodeInfoBuilder className(String className) {
            this.className = className;
            return this;
        }

        public GenCodeInfo build() {
            return new GenCodeInfo(this);
        }
    }
}
