//package dev.fyloz.trial.colorrecipesexplorer.exception.model;
//
//import dev.fyloz.trial.colorrecipesexplorer.model.IModel;
//import lombok.Getter;
//import lombok.NonNull;
//import org.springframework.http.HttpStatus;
//import org.springframework.web.bind.annotation.ResponseStatus;
//
//@Getter
//@ResponseStatus(HttpStatus.CONFLICT)
//public class EntityAlreadyExistsException extends ModelException {
//
//    @NonNull
//    private IdentifierType identifierType;
//
//    private String identifierName;
//
//    @NonNull
//    private Object requestedId;
//
//    public EntityAlreadyExistsException(EntityAlreadyExistsException ex) {
//        this(ex.type, ex.identifierType, ex.identifierName, ex.requestedId);
//    }
//
//    public EntityAlreadyExistsException(Class<? extends IModel> type, IdentifierType identifierType, Object requestedId) {
//        super(type);
//        this.identifierType = identifierType;
//        this.requestedId = requestedId;
//    }
//
//    public EntityAlreadyExistsException(Class<? extends IModel> type, IdentifierType identifierType, String identifierName, Object requestedId) {
//        super(type);
//        this.identifierType = identifierType;
//        this.identifierName = identifierName != null ? identifierName : identifierType.getName();
//        this.requestedId = requestedId;
//    }
//}
