Package io.wcm.sling.commons.adapter
Class AdaptTo
java.lang.Object
io.wcm.sling.commons.adapter.AdaptTo
Utility methods around Sling
Adaptable.-
Method Summary
-
Method Details
-
notNull
@NotNull public static <T> T notNull(@NotNull @NotNull org.apache.sling.api.adapter.Adaptable adaptable, @NotNull @NotNull Class<T> type) Try to adapt the adaptable to the given type and ensures that it succeeds.- Type Parameters:
T- Type- Parameters:
adaptable- Adaptabletype- Type- Returns:
- Adaption result (not null)
- Throws:
UnableToAdaptException- if the adaption was not successful
-