Class ImproperTypeException

java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
io.github.lukebemish.brainfrick.lang.runtime.ImproperTypeException
All Implemented Interfaces:
Serializable

public class ImproperTypeException extends RuntimeException
An exception thrown to indicate that a type cannot be unboxed into another type. Differs from a ClassCastException in that no cast was attempted; there was just no known path from existing to target type.
See Also:
  • Field Details

    • existingType

      public final Class<?> existingType
      The original type of the object.
    • targetType

      public final Class<?> targetType
      The type that the object could not be unboxed to or turned into.
  • Constructor Details

    • ImproperTypeException

      public ImproperTypeException(String msg, Class<?> existingType, Class<?> targetType)
      Creates a new ImproperTypeException with the given message and initial and target types.
      Parameters:
      msg - The detail message.
      existingType - The original type of the object.
      targetType - The type the object could not be turned into.