Interface SubtypeInstantiator


public interface SubtypeInstantiator
Like Instantiator, but takes a supertype of the returned subtype. Implementations need to ensure that they really return the expected type. This pattern is sometimes needed for cases where the expected type has generics that cannot be expressed by a class object.
  • Method Summary

    Modifier and Type
    Method
    Description
    <T> T
    getInstance(Class<? super T> type)
     
  • Method Details

    • getInstance

      <T> T getInstance(Class<? super T> type)