All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.tosan.client.http.starter.impl.feign.CustomErrorDecoderConfig Maven / Gradle / Ivy

There is a newer version: 3.2.0
Show newest version
package com.tosan.client.http.starter.impl.feign;

import com.fasterxml.jackson.databind.ObjectMapper;
import com.tosan.client.http.starter.impl.feign.exception.TosanWebServiceException;
import com.tosan.client.http.starter.impl.feign.exception.TosanWebServiceRuntimeException;

import java.util.*;

/**
 * @author Ali Alimohammadi
 * @since 5/10/2021
 */
public class CustomErrorDecoderConfig {
    private ExceptionExtractType exceptionExtractType;
    private Map> exceptionMap = new HashMap<>();
    private Class checkedExceptionClass;
    private Class uncheckedExceptionClass;
    private List scanPackageList = new ArrayList<>();
    private ObjectMapper objectMapper;

    public ExceptionExtractType getExceptionExtractType() {
        return exceptionExtractType;
    }

    public void setExceptionExtractType(ExceptionExtractType exceptionExtractType) {
        this.exceptionExtractType = exceptionExtractType;
    }

    public Map> getExceptionMap() {
        return exceptionMap;
    }

    public void setExceptionMap(Map> exceptionMap) {
        this.exceptionMap = exceptionMap;
    }

    public Class getCheckedExceptionClass() {
        return checkedExceptionClass;
    }

    public void setCheckedExceptionClass(Class checkedExceptionClass) {
        this.checkedExceptionClass = checkedExceptionClass;
    }

    public Class getUncheckedExceptionClass() {
        return uncheckedExceptionClass;
    }

    public void setUncheckedExceptionClass(Class uncheckedExceptionClass) {
        this.uncheckedExceptionClass = uncheckedExceptionClass;
    }

    public List getScanPackageList() {
        return scanPackageList;
    }

    public CustomErrorDecoderConfig addPackage(String packageName) {
        if (this.scanPackageList == null) {
            this.scanPackageList = new ArrayList<>();
        }
        this.scanPackageList.add(packageName);
        return this;
    }

    public CustomErrorDecoderConfig addPackages(String... packageNames) {
        if (this.scanPackageList == null) {
            this.scanPackageList = new ArrayList<>();
        }
        this.scanPackageList.addAll(Arrays.asList(packageNames));
        return this;
    }

    public ObjectMapper getObjectMapper() {
        return objectMapper;
    }

    public void setObjectMapper(ObjectMapper objectMapper) {
        this.objectMapper = objectMapper;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy