package com.ai.da.model.enums;

import com.fasterxml.jackson.annotation.JsonValue;

public enum DesignProcess implements IEnumDisplay {

    SERIES_DESIGN("Series design"),
    SINGLE_DESIGN("Single design"),
    FINISHED_PRODUCT("Finished product"),
    PRINT_DESIGN("Print design"),
    SKETCH_COLLAGE_PROCESS("Sketch Collage process"),
    THREE_D_PLATE_MAKING("3D plate making"),
    TO_PRODUCT_IMAGE("To product image"),
    RELIGHT("Relight"),
    POSE_TRANSFER("Pose transfer"),
    CANVAS("Canvas"),
    DE_RECONSTRUCTION("De/Reconstruction"),
    ;

    private final String value;

    DesignProcess(String value) {
        this.value = value;
    }

    @Override
    @JsonValue
    public String getValue() {
        return this.value;
    }

    public static DesignProcess getProcess(String value) {
        for (DesignProcess process : values()) {
            if (process.value.equalsIgnoreCase(value)) {
                return process;
            }
        }
        throw new IllegalArgumentException("No matching constant for [" + value + "]");
    }

    public static boolean isValidName(String name) {
        for (DesignProcess process : DesignProcess.values()) {
            if (process.name().equalsIgnoreCase(name)) {
                return true;
            }
        }
        return false;
    }
}
