org.springframework.data.mapping.model

## Class MappingInstantiationException

- java.lang.Object
- - java.lang.Throwable
  - - java.lang.Exception
    - - java.lang.RuntimeException
      - - org.springframework.data.mapping.model.MappingInstantiationException

All Implemented Interfaces:
  Serializable

    public class MappingInstantiationException
    extends RuntimeException

Exception being thrown in case an entity could not be instantiated in the process of a to-object-mapping.

Author:
  Oliver Gierke, Jon Brisbin, Christoph Strobl, Mark Paluch
See Also:
  Serialized Form

### Constructor Summary

Constructors
Constructor and Description
`MappingInstantiationException(List<Object> arguments, Exception cause)` Creates a new `MappingInstantiationException` for the given constructor arguments and the causing exception.
`MappingInstantiationException(PersistentEntity<?,?> entity, List<Object> arguments, Exception cause)` Creates a new `MappingInstantiationException` for the given `PersistentEntity`, constructor arguments and the causing exception.

### Method Summary

All Methods Instance Methods Concrete Methods
`Optional<Constructor<?>>` `getConstructor()` The constructor used during the instantiation attempt.
`List<Object>` `getConstructorArguments()` The constructor arguments used to invoke the constructor.
`Optional<Class<?>>` `getEntityType()` Returns the type of the entity that was attempted to instantiate.

### Methods inherited from class java.lang.Throwable

`addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

### Constructor Detail

#### MappingInstantiationException

    public MappingInstantiationException(PersistentEntity<?,?> entity,
                                         List<Object> arguments,
                                         Exception cause)

Creates a new `MappingInstantiationException` for the given `PersistentEntity`, constructor arguments and the causing exception.

Parameters:
  `entity` -
  `arguments` -
  `cause` -

#### MappingInstantiationException

    public MappingInstantiationException(List<Object> arguments,
                                         Exception cause)

Creates a new `MappingInstantiationException` for the given constructor arguments and the causing exception.

Parameters:
  `arguments` -
  `cause` -

### Method Detail

#### getEntityType

    public Optional<Class<?>> getEntityType()

Returns the type of the entity that was attempted to instantiate.

Returns:
  the entityType

#### getConstructor

    public Optional<Constructor<?>> getConstructor()

The constructor used during the instantiation attempt.

Returns:
  the constructor

#### getConstructorArguments

    public List<Object> getConstructorArguments()

The constructor arguments used to invoke the constructor.

Returns:
  the constructorArguments