Interface CloseableShapeshifter

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      <T> T as​(Class<T> clazz)
      Asks the Object to return itself as a concrete implementation of a specific interface.
    • Method Detail

      • as

        @Nullable
        <T> T as​(@Nonnull
                 Class<T> clazz)
        Asks the Object to return itself as a concrete implementation of a specific interface. The interface asked for will tend to be a semantically-meaningful interface.
        Type Parameters:
        T - The interface that the calling code wants a concrete implementation of
        Parameters:
        clazz - A class object representing the interface that the calling code wants a concrete implementation of
        Returns:
        A concrete implementation of the interface, or null if there is no meaningful optimization to be had through a local implementation of the interface.