Interface HasThrows<T extends HasThrows<T>>

  • Type Parameters:
    T - the extending type
    All Known Subinterfaces:
    Constructor, InterfaceMethod, Method

    public interface HasThrows<T extends HasThrows<T>>
    A trait for models that can throw exceptions.
    Since:
    2.0
    Author:
    Emil Forslund
    • Method Detail

      • add

        default T add​(Type exception)
        Adds the specified exception reference to the throws-clause of this model.
        Parameters:
        exception - the new exception
        Returns:
        a reference to this
      • throwing

        default T throwing​(Type exception)
        Adds the specified exception reference to the throws-clause of this model. This is a synonym of add(Type).
        Parameters:
        exception - the new exception
        Returns:
        a reference to this
      • getExceptions

        Set<Type> getExceptions()
        Returns a Set with all the exceptions that can be thrown by this model.

        The set returned must be mutable for changes!

        Returns:
        all exceptions