Interface InstanceProvider

All Known Implementing Classes:
BannedGenerator, CollectionGenerator, DefaultInstances, ExistingGenerator, PrimitiveGenerator
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface InstanceProvider
Represents a type generator for specific types.
  • Method Summary

    Modifier and Type
    Method
    Description
    create(Class<?> type)
    Create an instance given a type, if possible.
  • Method Details

    • create

      Object create(@Nullable Class<?> type)
      Create an instance given a type, if possible.
      Parameters:
      type - - type to create.
      Returns:
      The instance, or NULL if the type cannot be created.
      Throws:
      NotConstructableException - Thrown to indicate that this type cannot or should never be constructed.