Class AsExtensions


  • public class AsExtensions
    extends java.lang.Object
    Author:
    Fabrizio Giudici
    • Constructor Summary

      Constructors 
      Constructor Description
      AsExtensions()  
    • Method Summary

      All Methods Static Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      static <T> T as​(java.lang.Object datum, java.lang.Class<T> roleClass)  
      static <T> T as​(java.lang.Object datum, java.lang.Class<T> roleClass, As.NotFoundBehaviour<T> notFoundBehaviour)
      Deprecated.
      static <T> java.util.Collection<T> asMany​(java.lang.Object datum, java.lang.Class<T> roleClass)  
      static <T> java.util.Optional<T> maybeAs​(java.lang.Object datum, java.lang.Class<T> type)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • AsExtensions

        public AsExtensions()
    • Method Detail

      • as

        @Nonnull
        public static <T> T as​(@Nonnull
                               java.lang.Object datum,
                               @Nonnull
                               java.lang.Class<T> roleClass)
      • as

        @Nonnull
        @Deprecated
        public static <T> T as​(@Nonnull
                               java.lang.Object datum,
                               @Nonnull
                               java.lang.Class<T> roleClass,
                               @Nonnull
                               As.NotFoundBehaviour<T> notFoundBehaviour)
        Deprecated.
      • maybeAs

        @Nonnull
        public static <T> java.util.Optional<T> maybeAs​(@Nonnull
                                                        java.lang.Object datum,
                                                        @Nonnull
                                                        java.lang.Class<T> type)
      • asMany

        @Nonnull
        public static <T> java.util.Collection<T> asMany​(@Nonnull
                                                         java.lang.Object datum,
                                                         @Nonnull
                                                         java.lang.Class<T> roleClass)