Class Exceptions

java.lang.Object
io.github.torand.javacommons.lang.Exceptions

public final class Exceptions extends Object
Provides factory methods to create exception objects with customized messages.
  • Method Details

    • illegalStateException

      public static Supplier<IllegalStateException> illegalStateException(String message, Object... args)
      Creates a supplier of IllegalStateException with a customized message.
      Parameters:
      message - the message.
      args - the message parameters.
      Returns:
      the supplier.
    • illegalArgumentException

      public static Supplier<IllegalArgumentException> illegalArgumentException(String message, Object... args)
      Creates a supplier of IllegalArgumentException with a customized message.
      Parameters:
      message - the message.
      args - the message parameters.
      Returns:
      the supplier.
    • runtimeException

      public static Supplier<RuntimeException> runtimeException(String message, Object... args)
      Creates a supplier of RuntimeException with a customized message.
      Parameters:
      message - the message.
      args - the message parameters.
      Returns:
      the supplier.