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

com.coveo.feign.ThrownExceptionDetails Maven / Gradle / Ivy

Go to download

A Feign reflection error decoder that eases the pain in rethrowing checked and unchecked exceptions.

There is a newer version: 3.1.1
Show newest version
package com.coveo.feign;

import java.lang.reflect.InvocationTargetException;

public class ThrownExceptionDetails {
  private Class clazz;
  private ExceptionSupplier exceptionSupplier;

  public Class getClazz() {
    return clazz;
  }

  public void setClazz(Class clazz) {
    this.clazz = clazz;
  }

  public ExceptionSupplier getServiceExceptionSupplier() {
    return exceptionSupplier;
  }

  public void setServiceExceptionSupplier(ExceptionSupplier serviceExceptionSupplier) {
    this.exceptionSupplier = serviceExceptionSupplier;
  }

  public ThrownExceptionDetails withClazz(Class clazz) {
    setClazz(clazz);
    return this;
  }

  public ThrownExceptionDetails withServiceExceptionSupplier(ExceptionSupplier supplier) {
    setServiceExceptionSupplier(supplier);
    return this;
  }

  public T instantiate()
      throws InstantiationException, IllegalAccessException, IllegalArgumentException,
          InvocationTargetException {
    return exceptionSupplier.get();
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy