接口 NestedException

所有已知实现类:
AnnotationConfigurationException, CodecException, CodeGenerationException, ConstructorNotFoundException, ConversionException, ConversionFailedException, ConverterNotFoundException, DecodingException, EncodingException, NestedCheckedException, NestedRuntimeException, NoStackTraceRuntimeException, ReflectionException, SerializationFailedException, UndeclaredThrowableException

public interface NestedException
Handy class for wrapping Exceptions with a root cause. This class is abstract to force the programmer to extend the class.

This interface is for exception handling

从以下版本开始:
4.0 2024/3/14 10:37
作者:
Harry Yang
另请参阅:
  • 方法概要

    修饰符和类型
    方法
    说明
    boolean
    contains(Class<?> exType)
    Check whether this exception contains an exception of the given type: either it is of the given class itself or it contains a nested cause of the given type.
    Retrieve the most specific cause of this exception, that is, either the innermost cause (root cause) or this exception itself.
    Return the detail message, including the message from the nested exception if there is one.
    Retrieve the innermost cause of this exception, if any.
  • 方法详细资料

    • getNestedMessage

      @Nullable String getNestedMessage()
      Return the detail message, including the message from the nested exception if there is one.
    • getRootCause

      @Nullable Throwable getRootCause()
      Retrieve the innermost cause of this exception, if any.
      返回:
      the innermost exception, or null if none
    • getMostSpecificCause

      Throwable getMostSpecificCause()
      Retrieve the most specific cause of this exception, that is, either the innermost cause (root cause) or this exception itself.

      Differs from getRootCause() in that it falls back to the present exception if there is no root cause.

      返回:
      the most specific cause (never null)
    • contains

      boolean contains(@Nullable Class<?> exType)
      Check whether this exception contains an exception of the given type: either it is of the given class itself or it contains a nested cause of the given type.
      参数:
      exType - the exception type to look for
      返回:
      whether there is a nested exception of the specified type