Class TaggedIOException

  • All Implemented Interfaces:
    java.io.Serializable

    public class TaggedIOException
    extends IOExceptionWithCause
    An IOException wrapper that tags the wrapped exception with a given object reference. Both the tag and the wrapped original exception can be used to determine further processing when this exception is caught.
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor Description
      TaggedIOException​(java.io.IOException original, java.lang.Object tag)
      Creates a tagged wrapper for the given exception.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.io.IOException getCause()
      Returns the wrapped exception.
      java.lang.Object getTag()
      Returns the object reference used as the tag this exception.
      • Methods inherited from class java.lang.Throwable

        addSuppressed, fillInStackTrace, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • TaggedIOException

        public TaggedIOException​(java.io.IOException original,
                                 java.lang.Object tag)
        Creates a tagged wrapper for the given exception.
        Parameters:
        original - the exception to be tagged
        tag - tag object
    • Method Detail

      • getTag

        public java.lang.Object getTag()
        Returns the object reference used as the tag this exception.
        Returns:
        tag object
      • getCause

        public java.io.IOException getCause()
        Returns the wrapped exception. The only difference to the overridden Throwable.getCause() method is the narrower return type.
        Overrides:
        getCause in class java.lang.Throwable
        Returns:
        wrapped exception