Java RuntimeException Create toRuntimeException(Throwable throwable)

Here you can find the source of toRuntimeException(Throwable throwable)

Description

to Runtime Exception

License

Apache License

Declaration

public static RuntimeException toRuntimeException(Throwable throwable) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

public class Main {
    public static RuntimeException toRuntimeException(Throwable throwable) {
        return throwable instanceof RuntimeException ? (RuntimeException) throwable
                : new RuntimeException(throwable);
    }/*from  ww w. j  a  va2 s . c  o m*/

    public static RuntimeException toRuntimeException(String message, Throwable throwable) {
        return message == null ? toRuntimeException(throwable) : new RuntimeException(message, throwable);
    }
}

Related

  1. toRuntimeException(final Throwable e)
  2. toRuntimeException(Throwable e)
  3. toRuntimeException(Throwable t)
  4. toRuntimeException(Throwable t)
  5. toRuntimeException(Throwable throwable)
  6. toRuntimeExceptionOr(Class exClass, Throwable throwable)