@ Nullable public MongoCredential getCredential ( ) { if ( getCredentialsList ( ) . size ( ) > 1 ) { throw new IllegalStateException ( "Instance constructed with more than one MongoCredential" ) ; } else if ( getCredentialsList ( ) . isEmpty ( ) ) { return null ; } else { return getCredentialsList ( ) . get ( 0 ) ; } }
Gets the credential that this client authenticates all connections with