Interface OptionalSubtypeInstantiator


public interface OptionalSubtypeInstantiator
Like OptionalInstantiator, 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> Optional<T>
    getInstance(Class<? super T> type)
     
  • Method Details

    • getInstance

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