| Modifier and Type | Field and Description |
|---|---|
| protected ConcurrentHashMap | cache
Strategy cache. |
| protected final InstantiatorStrategy | strategy
Strategy used by this Objenesis implementation to create classes |
| Access | Constructor and Description |
|---|---|
| public | ObjenesisBase(InstantiatorStrategy
Strategy to use strategy)Constructor allowing to pick a strategy and using cache |
| public | ObjenesisBase(InstantiatorStrategy
Strategy to use strategy, boolean If useCache)ObjectInstantiators should be cachedFlexible constructor allowing to pick the strategy and if caching should be used |
| Modifier and Type | Method and Description |
|---|---|
| public <T> ObjectInstantiator | Returns: Instantiator dedicated to the classClass to instantiate clazz)Implements org. Will pick the best instantiator for the provided class. |
| public <T> T | Returns: New instance of clazzClass to instantiate clazz)Implements org. Will create a new object without any constructor being called |
| public String |
| cache | back to summary |
|---|---|
| protected ConcurrentHashMap<String, ObjectInstantiator<?>> cache Strategy cache. Key = Class, Value = InstantiatorStrategy | |
| strategy | back to summary |
|---|---|
| protected final InstantiatorStrategy strategy Strategy used by this Objenesis implementation to create classes | |
| ObjenesisBase | back to summary |
|---|---|
| public ObjenesisBase(InstantiatorStrategy strategy) Constructor allowing to pick a strategy and using cache
| |
| ObjenesisBase | back to summary |
|---|---|
| public ObjenesisBase(InstantiatorStrategy strategy, boolean useCache) Flexible constructor allowing to pick the strategy and if caching should be used
| |
| getInstantiatorOf | back to summary |
|---|---|
| public <T> ObjectInstantiator Implements org. Will pick the best instantiator for the provided class. If you need to create a lot of
instances from the same class, it is way more efficient to create them from the same
ObjectInstantiator than calling
| |
| newInstance | back to summary |
|---|---|
| public <T> T newInstance(Class<T> clazz) Implements org. Will create a new object without any constructor being called
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object.
Satisfying this method's contract implies a non- | |