CreationSettings
Date: 2015-09-18

org.mockito.internal.creation.settings

## Class CreationSettings<T>

- java.lang.Object
- - org.mockito.internal.creation.settings.CreationSettings<T>

- All Implemented Interfaces:
    java.io.Serializable, MockCreationSettings<T>
  Direct Known Subclasses:
    MockSettingsImpl

      public class CreationSettings<T>
      extends java.lang.Object
      implements MockCreationSettings<T>, java.io.Serializable

  by Szczepan Faber, created at: 4/9/12
  See Also:
    Serialized Form

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected Answer<java.lang.Object>` | `defaultAnswer`
    `protected java.util.Set<java.lang.Class>` | `extraInterfaces`
    `protected java.util.List<InvocationListener>` | `invocationListeners`
    `protected MockName` | `mockName`
    `protected java.lang.String` | `name`
    `protected SerializableMode` | `serializableMode`
    `protected java.lang.Object` | `spiedInstance`
    `protected boolean` | `stubOnly`
    `protected java.lang.Class<T>` | `typeToMock`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `CreationSettings()`
    `CreationSettings(CreationSettings copy)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `Answer<java.lang.Object>` | `getDefaultAnswer()` the default answer for this mock, see `MockSettings.defaultAnswer(org.mockito.stubbing.Answer)`.
    `java.util.Set<java.lang.Class>` | `getExtraInterfaces()` the extra interfaces the mock object should implement.
    `java.util.List<InvocationListener>` | `getInvocationListeners()` The invocation listeners attached to this mock, see `MockSettings.invocationListeners(org.mockito.listeners.InvocationListener...)`.
    `MockName` | `getMockName()` the name of this mock, as printed on verification errors; see `MockSettings.name(java.lang.String)`.
    `java.lang.String` | `getName()`
    `java.lang.Object` | `getOuterClassInstance()` Used when mocking non-static inner classes in conjunction with `MockCreationSettings.isUsingConstructor()`
    `SerializableMode` | `getSerializableMode()`
    `java.lang.Object` | `getSpiedInstance()` the spied instance - needed for spies.
    `java.lang.Class<T>` | `getTypeToMock()` Mocked type.
    `boolean` | `isSerializable()` if the mock is serializable, see `MockSettings.serializable()`.
    `boolean` | `isStubOnly()` Whether the mock is only for stubbing, i.e.
    `boolean` | `isUsingConstructor()` Informs whether the mock instance should be created via constructor
    `CreationSettings<T>` | `setExtraInterfaces(java.util.Set<java.lang.Class> extraInterfaces)`
    `CreationSettings<T>` | `setMockName(MockName mockName)`
    `CreationSettings<T>` | `setTypeToMock(java.lang.Class<T> typeToMock)`

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

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

- - ### Field Detail

    - #### typeToMock

          protected java.lang.Class<T> typeToMock

    - #### extraInterfaces

          protected java.util.Set<java.lang.Class> extraInterfaces

    - #### name

          protected java.lang.String name

    - #### spiedInstance

          protected java.lang.Object spiedInstance

    - #### defaultAnswer

          protected Answer<java.lang.Object> defaultAnswer

    - #### mockName

          protected MockName mockName

    - #### serializableMode

          protected SerializableMode serializableMode

    - #### invocationListeners

          protected java.util.List<InvocationListener> invocationListeners

    - #### stubOnly

          protected boolean stubOnly

  - ### Constructor Detail

    - #### CreationSettings

          public CreationSettings()

    - #### CreationSettings

          public CreationSettings(CreationSettings copy)

  - ### Method Detail

    - #### getTypeToMock

          public java.lang.Class<T> getTypeToMock()

      Description copied from interface: `MockCreationSettings`
      Mocked type. An interface or class the mock should implement / extend.
      Specified by:
        `getTypeToMock` in interface `MockCreationSettings<T>`

    - #### setTypeToMock

          public CreationSettings<T> setTypeToMock(java.lang.Class<T> typeToMock)

    - #### getExtraInterfaces

          public java.util.Set<java.lang.Class> getExtraInterfaces()

      Description copied from interface: `MockCreationSettings`
      the extra interfaces the mock object should implement.
      Specified by:
        `getExtraInterfaces` in interface `MockCreationSettings<T>`

    - #### setExtraInterfaces

          public CreationSettings<T> setExtraInterfaces(java.util.Set<java.lang.Class> extraInterfaces)

    - #### getName

          public java.lang.String getName()

    - #### getSpiedInstance

          public java.lang.Object getSpiedInstance()

      Description copied from interface: `MockCreationSettings`
      the spied instance - needed for spies.
      Specified by:
        `getSpiedInstance` in interface `MockCreationSettings<T>`

    - #### getDefaultAnswer

          public Answer<java.lang.Object> getDefaultAnswer()

      Description copied from interface: `MockCreationSettings`
      the default answer for this mock, see `MockSettings.defaultAnswer(org.mockito.stubbing.Answer)`.
      Specified by:
        `getDefaultAnswer` in interface `MockCreationSettings<T>`

    - #### getMockName

          public MockName getMockName()

      Description copied from interface: `MockCreationSettings`
      the name of this mock, as printed on verification errors; see `MockSettings.name(java.lang.String)`.
      Specified by:
        `getMockName` in interface `MockCreationSettings<T>`

    - #### setMockName

          public CreationSettings<T> setMockName(MockName mockName)

    - #### isSerializable

          public boolean isSerializable()

      Description copied from interface: `MockCreationSettings`
      if the mock is serializable, see `MockSettings.serializable()`.
      Specified by:
        `isSerializable` in interface `MockCreationSettings<T>`

    - #### getSerializableMode

          public SerializableMode getSerializableMode()

      Specified by:
        `getSerializableMode` in interface `MockCreationSettings<T>`
      Returns:
        the serializable mode of this mock

    - #### getInvocationListeners

          public java.util.List<InvocationListener> getInvocationListeners()

      Description copied from interface: `MockCreationSettings`
      The invocation listeners attached to this mock, see `MockSettings.invocationListeners(org.mockito.listeners.InvocationListener...)`.
      Specified by:
        `getInvocationListeners` in interface `MockCreationSettings<T>`

    - #### isUsingConstructor

          public boolean isUsingConstructor()

      Description copied from interface: `MockCreationSettings`
      Informs whether the mock instance should be created via constructor
      Specified by:
        `isUsingConstructor` in interface `MockCreationSettings<T>`

    - #### getOuterClassInstance

          public java.lang.Object getOuterClassInstance()

      Description copied from interface: `MockCreationSettings`
      Used when mocking non-static inner classes in conjunction with `MockCreationSettings.isUsingConstructor()`
      Specified by:
        `getOuterClassInstance` in interface `MockCreationSettings<T>`
      Returns:
        the outer class instance used for creation of the mock object via the constructor.

    - #### isStubOnly

          public boolean isStubOnly()

      Description copied from interface: `MockCreationSettings`
      Whether the mock is only for stubbing, i.e. does not remember parameters on its invocation and therefore cannot be used for verification
      Specified by:
        `isStubOnly` in interface `MockCreationSettings<T>`