private List < SchemaTableName > listViews ( Optional < String > filterSchema ) { ImmutableList . Builder < SchemaTableName > builder = ImmutableList . builder ( ) ; if ( filterSchema . isPresent ( ) ) { for ( String view : client . getViewNames ( filterSchema . get ( ) ) ) { builder . add ( new SchemaTableName ( filterSchema . get ( ) , view ) ) ; } } else { for ( String schemaName : client . getSchemaNames ( ) ) { for ( String view : client . getViewNames ( schemaName ) ) { builder . add ( new SchemaTableName ( schemaName , view ) ) ; } } } return builder . build ( ) ; }
Gets all views in the given schema or all schemas if null .