public < T extends AuthMethod > T getAuth ( Class < T > type ) throws NexmoUnacceptableAuthException { for ( AuthMethod availableAuthMethod : this . authList ) { if ( type . isInstance ( availableAuthMethod ) ) { return ( T ) availableAuthMethod ; } } throw new NexmoUnacceptableAuthException ( this . authList , new HashSet <> ( Arrays . asList ( new Class [ ] { type } ) ) ) ; }
Obtain an AuthMethod of type T if one is contained in this collection .