Groovy Documentation

## org.codehaus.groovy.runtime.typehandling
[Java] Class GroovyCastException

    java.lang.Object
      java.lang.Throwable
          java.lang.Exception
              java.lang.RuntimeException
                  java.lang.ClassCastException
                      org.codehaus.groovy.runtime.typehandling.GroovyCastException

    public class GroovyCastException
    extends java.lang.ClassCastException

Constructor Summary
`GroovyCastException(java.lang.Object objectToCast, java.lang.Class classToCastTo, java.lang.Exception cause)` @param objectToCast object we tried to cast
`GroovyCastException(java.lang.Object objectToCast, java.lang.Class classToCastTo)` @param objectToCast object we tried to cast
`GroovyCastException(java.lang.String message)` @param message custom Exception message

Method Summary

Methods inherited from class java.lang.ClassCastException

java.lang.ClassCastException#printStackTrace(), java.lang.ClassCastException#printStackTrace(java.io.PrintStream), java.lang.ClassCastException#printStackTrace(java.io.PrintWriter), java.lang.ClassCastException#fillInStackTrace(), java.lang.ClassCastException#getCause(), java.lang.ClassCastException#initCause(java.lang.Throwable), java.lang.ClassCastException#toString(), java.lang.ClassCastException#getMessage(), java.lang.ClassCastException#getLocalizedMessage(), java.lang.ClassCastException#getStackTrace(), java.lang.ClassCastException#setStackTrace([Ljava.lang.StackTraceElement;), java.lang.ClassCastException#addSuppressed(java.lang.Throwable), java.lang.ClassCastException#getSuppressed(), java.lang.ClassCastException#wait(long), java.lang.ClassCastException#wait(long, int), java.lang.ClassCastException#wait(), java.lang.ClassCastException#equals(java.lang.Object), java.lang.ClassCastException#hashCode(), java.lang.ClassCastException#getClass(), java.lang.ClassCastException#notify(), java.lang.ClassCastException#notifyAll()

Methods inherited from class java.lang.RuntimeException

java.lang.RuntimeException#printStackTrace(), java.lang.RuntimeException#printStackTrace(java.io.PrintStream), java.lang.RuntimeException#printStackTrace(java.io.PrintWriter), java.lang.RuntimeException#fillInStackTrace(), java.lang.RuntimeException#getCause(), java.lang.RuntimeException#initCause(java.lang.Throwable), java.lang.RuntimeException#toString(), java.lang.RuntimeException#getMessage(), java.lang.RuntimeException#getLocalizedMessage(), java.lang.RuntimeException#getStackTrace(), java.lang.RuntimeException#setStackTrace([Ljava.lang.StackTraceElement;), java.lang.RuntimeException#addSuppressed(java.lang.Throwable), java.lang.RuntimeException#getSuppressed(), java.lang.RuntimeException#wait(long), java.lang.RuntimeException#wait(long, int), java.lang.RuntimeException#wait(), java.lang.RuntimeException#equals(java.lang.Object), java.lang.RuntimeException#hashCode(), java.lang.RuntimeException#getClass(), java.lang.RuntimeException#notify(), java.lang.RuntimeException#notifyAll()

Constructor Detail

### GroovyCastException

    public GroovyCastException(java.lang.Object objectToCast, java.lang.Class classToCastTo, java.lang.Exception cause)

  Parameters:
    `objectToCast` - object we tried to cast
    `classToCastTo` - class we tried to cast to
    `cause` - not kept but we pass on message from this Exception if any

### GroovyCastException

    public GroovyCastException(java.lang.Object objectToCast, java.lang.Class classToCastTo)

  Parameters:
    `objectToCast` - object we tried to cast
    `classToCastTo` - class we tried to cast to

### GroovyCastException

    public GroovyCastException(java.lang.String message)

  Parameters:
    `message` - custom Exception message

Groovy Documentation