@ Nonnull @ ReturnsMutableCopy public static final < T extends AbstractSingleton > ICommonsList < T > getAllSingletons ( @ Nullable final IScope aScope , @ Nonnull final Class < T > aDesiredClass ) { ValueEnforcer . notNull ( aDesiredClass , "DesiredClass" ) ; final ICommonsList < T > ret = new CommonsArrayList <> ( ) ; if ( aScope != null ) for ( final Object aScopeValue : aScope . attrs ( ) . values ( ) ) if ( aScopeValue != null && aDesiredClass . isAssignableFrom ( aScopeValue . getClass ( ) ) ) ret . add ( aDesiredClass . cast ( aScopeValue ) ) ; return ret ; }
Get all singleton objects registered in the respective sub - class of this class .